3.1. Configuring JDBC drivers
Before you can connect to a DBMS you have to configure the JDBC
driver to be used. The driver configuration is available in the connection
dialog or through →
The configuration of a specific driver requires at least two properties:
- the driver's class name
- the library ("JAR file") where to find the driver class
The name of the library has to contain the full path to the driver's jar file, so that
SQL Workbench/J can find it. If a driver requires more than one library,
select all necessary libraries in the file open dialog, or enter all the
filenames separated by a semicolon (or a colon on Unix style operating systems).
This is also true for drivers that require a license file that is contained in a jar file.
In this case you have to include the license jar in the list of files. Basically this list defines
the classpath for the classloader that is used to load and instantiate the driver.
If the driver accesses files through its classpath definition that are not
contained in a jar library, you have to include that directory as part
of the library definition (e.g: "c:\etc\TheDriver\jdbcDriver.jar;c:\etc\TheDriver"
).
The file selection dialog will not let you select a directory, so you have
to add it manually to the library definition.
![[Note]](./images/note.gif) | |
---|
SQL Workbench/J is not using
the system CLASSPATH definition (i.e. environment variable) to load the
driver classes. Changing the CLASSPATH environment variable to include
your driver's library will not work.
|
You do not need to specify a library for the JDBC-ODBC bridge, as
the necessary drivers are already part of the Java runtime.
You can assign a sample URL to each driver, which will be put into
the URL property of the profile, when the driver class is selected.
SQL Workbench/J comes with some sample URLs pre-configured.
Some of these sample URLs use brackets to indicate a parameters that need
to be replaced with the actual value for your connection: (servername)
In this case the entire sequence including the brackets need to be replaced with the
actual value.
3.2. Specifying a library directory
When defining the location of the driver's .jar file, you can use the placeholder
%LibDir%
instead of the using the directory's name directly.
This way your WbDrivers.xml
is portable across installations.
To specify the library directory, either set it in the workbench.settings
file, or specify the directory using the -libdir
switch when starting the application.