Contents Index Database options set for jConnect connections Establishing JDBC connections

ASA Programming Guide
  JDBC Programming

Using the iAnywhere JDBC driver


The iAnywhere JDBC driver provides a JDBC driver that has some performance benefits and feature benefits compared to the pure Java jConnect JDBC driver, but which is not a pure-Java solution.

For information on choosing which JDBC driver to use, see Choosing a JDBC driver.

Required files 

The Java component of the iAnywhere JDBC driver is included in the jodbc.jar file installed into the Java subdirectory of your SQL Anywhere installation. For Windows, the native component is dbjodbc9.dll in the win32 subdirectory of your SQL Anywhere installation; for UNIX and Linux, the native component is dbjodbc9.so. This component must be in the system path. When deploying applications using this driver, you must also deploy the ODBC driver files.

Establishing a connection 

The following code illustrates how to establish a connection using the iAnywhere JDBC driver:

String     driver, url;
Connection  conn;
driver="ianywhere.ml.jdbcodbc.IDriver";
url = "jdbc:odbc:dsn=ASA 9.0 Sample";
Class.forName( driver );
conn = DriverManager.getConnection( url );

There are several things to note about this code:

Character sets 

On UNIX the iAnywhere JDBC driver does not use ODBC Unicode bindings or calls and does not carry out character translations. Sending non-ASCII data through the iAnywhere JDBC driver leads to data corruption.

On Windows the iAnywhere JDBC driver does use ODBC Unicode bindings and calls to translate among character sets.


Contents Index Database options set for jConnect connections Establishing JDBC connections