JDBC Driver for Btrieve

Build 22.0.8462

Establishing a Connection

Creating a JDBC Data Source

You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for Btrieve consists of three basic steps:

  • Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
  • Provide the driver class. For example:
    cdata.jdbc.btrieve.BtrieveDriver
  • Provide the JDBC URL. For example:
    jdbc:btrieve:user=myuser;password=mypassword;Server=localhost;Database=C:\\ProgramData\\Actian\\PSQL\\Demodata
    
    or
    
    jdbc:cdata:btrieve:user=myuser;password=mypassword;Server=localhost;Database=C:\\ProgramData\\Actian\\PSQL\\Demodata

    The second format above can be used whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:btrieve:" or "jdbc:cdata:btrieve:" and can include any of the connection properties in name-value pairs separated with semicolons.

Installing the PSQL Client

An installation of the PSQL Client is required to establish a connection to Btrieve. Acquire the PSQL Client from the Actian download page.

  • Product: Select Actian Zen (PSQL).
  • Release: PSQL v12, v13, and v14 are supported.
  • Platform: Select your platform.
  • A dropdown menu appears. Scroll down to find the PSQL client download link.

You must install the PSQL client on the same machine as the driver.

Connecting to Btrieve

With the PSQL client installed, the driver can now connect to Btrieve.

Set the following connection properties:

  • Server: The default value is localhost. If your database is not on the local machine, set the value to the hostname or IP of the remote machine.
  • Database: Set to the directory containing the Btrieve database files if DatabaseLocation is empty, or the name of the database when DatabaseLocation is set to the database path.
  • User: Set this to the username used to authenticate to Btrieve.
  • Password: Set this to the password used to authenticate to Btrieve.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462