Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Query SingleStore Data in DataGrip
Create a Data Source for SingleStore in DataGrip and use SQL to query live SingleStore data.
DataGrip is a database IDE that allows SQL developers to query, create, and manage databases. When paired with the CData JDBC Driver for SingleStore, DataGrip can work with live SingleStore data. This article shows how to establish a connection to SingleStore data in DataGrip and use the table editor to load SingleStore data.
Create a New Driver Definition for SingleStore
The steps below describe how to create a new Data Source in DataGrip for SingleStore.
- In DataGrip, click File -> New > Project and name the project
- In the Database Explorer, click the plus icon () and select Driver.
- In the Driver tab:
- Set Name to a user-friendly name (e.g. "CData SingleStore Driver")
- Set Driver Files to the appropriate JAR file. To add the file, click the plus (), select "Add Files," navigate to the "lib" folder in the driver's installation directory and select the JAR file (e.g. cdata.jdbc.singlestore.jar).
- Set Class to cdata.jdbc.singlestore.SingleStore.jar
Additionally, in the advanced tab you can change driver properties and some other settings like VM Options, VM environment, VM home path, DBMS, etc - For most cases, change the DBMS type to "Unknown" in Expert options to avoid native SQL Server queries (Transact-SQL), which might result in an invalid function error
- Click "Apply" then "OK" to save the Connection
Configure a Connection to SingleStore
- Once the connection is saved, click the plus (), then "Data Source" then "CData SingleStore Driver" to create a new SingleStore Data Source.
- In the new window, configure the connection to SingleStore with a JDBC URL.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the SingleStore JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.singlestore.jar
Fill in the connection properties and copy the connection string to the clipboard.
The following connection properties are required in order to connect to data.
- Server: The host name or IP of the server hosting the SingleStore database.
- Port: The port of the server hosting the SingleStore database.
- Database (Optional): The default database to connect to when connecting to the SingleStore Server. If this is not set, tables from all databases will be returned.
Connect Using Standard Authentication
To authenticate using standard authentication, set the following:
- User: The user which will be used to authenticate with the SingleStore server.
- Password: The password which will be used to authenticate with the SingleStore server.
Connect Using Integrated Security
As an alternative to providing the standard username and password, you can set IntegratedSecurity to True to authenticate trusted users to the server via Windows Authentication.
Connect Using SSL Authentication
You can leverage SSL authentication to connect to SingleStore data via a secure session. Configure the following connection properties to connect to data:
- SSLClientCert: Set this to the name of the certificate store for the client certificate. Used in the case of 2-way SSL, where truststore and keystore are kept on both the client and server machines.
- SSLClientCertPassword: If a client certificate store is password-protected, set this value to the store's password.
- SSLClientCertSubject: The subject of the TLS/SSL client certificate. Used to locate the certificate in the store.
- SSLClientCertType: The certificate type of the client store.
- SSLServerCert: The certificate to be accepted from the server.
Connect Using SSH Authentication
Using SSH, you can securely login to a remote machine. To access SingleStore data via SSH, configure the following connection properties:
- SSHClientCert: Set this to the name of the certificate store for the client certificate.
- SSHClientCertPassword: If a client certificate store is password-protected, set this value to the store's password.
- SSHClientCertSubject: The subject of the TLS/SSL client certificate. Used to locate the certificate in the store.
- SSHClientCertType: The certificate type of the client store.
- SSHPassword: The password that you use to authenticate with the SSH server.
- SSHPort: The port used for SSH operations.
- SSHServer: The SSH authentication server you are trying to authenticate against.
- SSHServerFingerPrint: The SSH Server fingerprint used for verification of the host you are connecting to.
- SSHUser: Set this to the username that you use to authenticate with the SSH server.
- Set URL to the connection string, e.g.,
jdbc:singlestore:User=myUser;Password=myPassword;Database=NorthWind;Server=myServer;Port=3306;
- Click "Apply" and "OK" to save the connection string
At this point, you will see the data source in the Data Explorer.
Execute SQL Queries Against SingleStore
To browse through the SingleStore entities (available as tables) accessible through the JDBC Driver, expand the Data Source.
![Exploring the data (Salesforce is shown.)](../articles/jdbc-datagrip-6.png)
To execute queries, right click on any table and select "New" -> "Query Console."
![Opening a new Query Console.](../articles/jdbc-datagrip-7.png)
In the Console, write the SQL query you wish to execute. For example: SELECT ShipName, ShipCity FROM Orders WHERE ShipCountry = 'USA'
![Querying with SQL (Salesforce is shown.)](../articles/jdbc-datagrip-8.png)
Download a free, 30-day trial of the CData JDBC Driver for SingleStore and start working with your live SingleStore data in DataGrip. Reach out to our Support Team if you have any questions.