Deploying JDBC clients

You must install a Java Runtime Environment to use JDBC.

You may need to define the JAVA_HOME environment variable, if it has not already been defined, so that the database server can locate the Java VM. The JAVA_HOME or JAVAHOME environment variables are commonly created when installing a Java VM. This environment variable should point to the root directory of your Java VM.

The database server searches for the Java VM in the following order:

  1. Check the java_location database option.
  2. Check the JAVA_HOME environment variable.
  3. Check the JAVAHOME environment variable.
  4. Check the path.
  5. If these searches fail, then the database server fails to load the Java VM.

If the JAVAHOME environment variable is defined and the client computer has JAVA_HOME already defined, the server uses JAVA_HOME.

In addition to a Java Runtime Environment, each JDBC client requires the iAnywhere JDBC driver or jConnect.

iAnywhere JDBC driver

To deploy the iAnywhere JDBC driver, you must deploy the following files:

  • jodbc.jar This must be in the application's classpath. This file is located in the SQL Anywhere installation java folder.
  • dbjodbc11.dll This must be locatable in the system path. On Unix environments, the file is a shared library called libdbjodbc11.so. On MAC OS X, the file is a shared library called libdbjodbc11.jnilib.
  • The ODBC driver files. For more information, see ODBC driver required files.
jConnect JDBC driver

To deploy the jConnect JDBC driver, you must deploy the following files:

  • The jConnect driver files. For a version of the jConnect software and the jConnect documentation, see [external link] jConnect for JDBC.
  • When you use a TDS client (either Open Client or jConnect based), you have the option of sending the connection password in clear text or in encrypted form. The latter is done by performing a TDS encrypted password handshake. The handshake involves using private/public key encryption. The support for generating the RSA private/public key pair and for decrypting the encrypted password is included in a special library. The library file must locatable in the system path. For Windows, this file is called dbrsakp11.dll. There are both 64-bit and 32-bit versions of the DLL. On Unix environments, the file is a shared library called libdbrsakp11.so. On MAC OS X, the file is a shared library called libdbrsakp11.jnilib. The file is not necessary if you do not use this feature.
JDBC database connection URL

Your Java application needs a URL to connect to the database. This URL specifies the driver, the computer to use, and the port on which the database server is listening.

For more information about URLs, see Supplying a URL to the driver.