Manage Lakebase Data in DBArtisan as a JDBC Source
The CData JDBC Driver for Lakebase seamlessly integrates Lakebase data into database management tools like DBArtisan by enabling you to access Lakebase data as a database. This article shows how to create a JDBC source for Lakebase in DBArtisan. You can then edit data visually and execute standard SQL.
Integrate Lakebase Data into DBArtisan Projects
Follow the steps below to register Lakebase data as a database instance in your project:
- In DBArtisan, click Data Source -> Register Datasource.
- Select Generic JDBC.
- Click Manage.
- In the resulting dialog, click New. Enter a name for the driver and click Add. In the resulting dialog, navigate to the driver JAR. The driver JAR is located in the lib subfolder of the installation directory.
-
In the Connection URL box, enter credentials and other required connection properties in the JDBC URL.
To connect to Databricks Lakebase, start by setting the following properties:
- DatabricksInstance: The Databricks instance or server hostname, provided in the format instance-abcdef12-3456-7890-abcd-abcdef123456.database.cloud.databricks.com.
- Server: The host name or IP address of the server hosting the Lakebase database.
- Port (optional): The port of the server hosting the Lakebase database, set to 5432 by default.
- Database (optional): The database to connect to after authenticating to the Lakebase Server, set to the authenticating user's default database by default.
OAuth Client Authentication
To authenicate using OAuth client credentials, you need to configure an OAuth client in your service principal. In short, you need to do the following:
- Create and configure a new service principal
- Assign permissions to the service principal
- Create an OAuth secret for the service principal
For more information, refer to the Setting Up OAuthClient Authentication section in the Help documentation.
OAuth PKCE Authentication
To authenticate using the OAuth code type with PKCE (Proof Key for Code Exchange), set the following properties:
- AuthScheme: OAuthPKCE.
- User: The authenticating user's user ID.
For more information, refer to the Help documentation.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the Lakebase JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.lakebase.jar
Fill in the connection properties and copy the connection string to the clipboard.
Below is a typical connection string:
jdbc:lakebase:DatabricksInstance=lakebase;Server=127.0.0.1;Port=5432;Database=my_database;InitiateOAuth=GETANDREFRESH;
- Finish the wizard to connect to Lakebase data. Lakebase entities are displayed in the Datasource Explorer.
You can now work with Lakebase data as you work with any other database. See the driver help documentation for more information on the queries supported by the Lakebase API.