Connect to Lakebase Data in RazorSQL

Jerod Johnson
Jerod Johnson
Senior Technology Evangelist
Connect to Lakebase from wizards and query Lakebase data from the GUI in the RazorSQL database management tool.

The CData JDBC Driver for Lakebase enables standards-based access from third-party tools, from wizards in IDEs to data management and analysis tools. This article shows how to connect to Lakebase using wizards in RazorSQL.

Create a JDBC Data Source for Lakebase Data

  1. Open the RazorSQL application and, in the Connections menu, select Add Connection Profile -> Other -> JDBC.
  2. In the Connection Wizard that appears, set the following properties:
    • Driver Location: Set this property to the path to the lib subfolder in the installation directory.
    • Driver Class: Set the driver class to cdata.jdbc.lakebase.LakebaseDriver.
    • Username: Enter the username. (This property can also be set in the JDBC URL.)
    • Password: Enter the password. (This property can also be set in the JDBC URL.)
    • JDBC URL: Enter connection parameters. The JDBC URL begins with jdbc:lakebase: and is followed by a semicolon-separated list of connection properties.

      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:

      1. Create and configure a new service principal
      2. Assign permissions to the service principal
      3. 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.

      A typical JDBC URL is the following:

      jdbc:lakebase:DatabricksInstance=lakebase;Server=127.0.0.1;Port=5432;Database=my_database;InitiateOAuth=GETANDREFRESH;

Query Lakebase Data and Select Tables

After establishing a connection, the wizard will close and the connection will be available in the connections panel. You can then query the tables.

Ready to get started?

Download a free trial of the Lakebase Driver to get started:

 Download Now

Learn more:

Lakebase Icon Lakebase JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with Lakebase.