Using a JDBC driver requires knowledge of the following information:
The JDBC Driver implementation of the java.sql.Driver interface
The URL for connecting to the desired database
The BBj JDBC Driver implementation of the Java.SQL.Driver interface is as follows:
com.basis.jdbc.BasisDriver
In order to have access to the com.basis.jdbc.BasisDriver class, the CLASSPATH environment variable must include the location of the BBjJDBC.jar file. This file is located in the <bbj install>/lib directory.
To make a connection to the JDBC driver, use a connect string in the following format:
jdbc:basis:<server>:<port>?database=<database_name>&user=<user_name>&pwd=<password>
The important properties that can be specified are as follows:
|
database=<database_name> |
Database on the BBj SQL server to open. The database name must be provided |
|
user=<user_name> |
Specify a BBj SQL user to open the database. |
|
pwd=<password> |
Specify a BBj SQL password for the provided user to authenticate with. |
|
BBj 4.0 and higher |
|
|
ssl=<true or false>
|
Indicate whether the BBj SQL server is running using SSL. If this property is set to "true", the server must be using SSL in order to connect. Alternately, if this property is set to "false", the client will be unable to connect to a server that is using SSL. This is to ensure that the user knows whether or not the connection to the BBj SQL server is secure. |
|
keystore=<keystore> |
This is entirely optional. If a user wants to specify their own SSL keys and authentication connecting to the BBj SQL server this property indicates where the keystore is to be found. If this parameter is not specified, the default keystore is used. |
|
keypass=<keystore pwd> |
This is entirely optional. If a user has specified their own keystore, they must provide the appropriate keystore password. If this parameter is not specified, the keystore password for the default keystore is used. |
|
BBj 6.0 and higher |
|
|
readonly=<true or false> |
Set the connection to be read only or read-write. This setting does NOT bypass underlying security settings for the database. |
|
data=<path to DATA directory> |
Bypasses the location of the data files as specified in the DATA setting for the database. This setting will be used to replace all references in file paths to the (DATA) global setting. |
|
dictionary=<path to DICTIONARY files> |
Bypasses the location of the dictionary files specified in the database properties so that the SQL engine will look in this new location for its data dictionary files. |
|
txn_isolation=<level> |
Specifies the transaction isolation level if the database supports transactions. The database supports transactions only on ESQL tables. Supported values are: NONE, READ_COMMITTED, READ_UNCOMMITTED, REPEATABLE_READ, and SERIALIZABLE. |
|
timeout=<seconds> |
Amount of time in seconds that the connection should wait for a response from the server during an operation before giving up. |
|
autocommit=<true or false> |
If true, all statements will be automatically committed at the time of their execution. If set to false, UPDATE and INSERT statements will not be permanently saved to disk until a commit is performed (only on files that support transactions such as ESQL files). |
|
padvarlength=<true or false> |
If set to true, VARCHAR values will get padded with spaces to the complete length defined for the column before being written to the table. |
For example, to connect to the sample Chile Company database that is installed with the BASIS DBMS located on a machine called "myserver," use the following connect string:
jdbc:basis:myserver?database=ChileCompany&user=admin&pwd=admin123
Note that if the port is omitted, the default port of 2001 is used.
|
... |
For information about using a JDBC driver in a third party JDBC application, refer to the third party documentation.
For additional information on the JDBC API and how it works, visit the Sun Java Web site at http://java.sun.com.