Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere JDBC API

 

Using the jConnect JDBC driver

SQL Anywhere supports one version of jConnect: jConnect 6.0.5. The jConnect driver is available as a separate download from [external link] jConnect for JDBC. Documentation for jConnect can also be found on the same page.

If you want to use JDBC from an applet, you must use the jConnect JDBC driver to connect to SQL Anywhere databases.

The jConnect driver files

SQL Anywhere supports the following version of jConnect:

  • jConnect 6.0.5   This version of jConnect is for developing JDK 1.4 or later applications. jConnect 6.0.5 is JDBC 3.0 compliant. jConnect 6.0.5 is supplied as a JAR file named jconn3.jar.

Note

For the purposes of this documentation, all of the explanations and code samples provided assume that you are developing JDK 1.5 applications, and that you are using the jConnect 6.0.5 driver.

There is a copy of jconn3.jar in the install-dir\java folder. However, we recommend that you use the version of the file included with jConnect 6.0.5 since it will be current with the version of jConnect that you have installed.

Setting the class path for jConnect

For your application to use jConnect, the jConnect classes must be in your class path at compile time and run time, so that the Java compiler and Java runtime can locate the necessary files.

The following command adds the jConnect 6.0.5 driver to an existing CLASSPATH environment variable (where path is your jConnect installation directory).

set classpath=path\jConnect-6_0\classes\jconn3.jar;%classpath%
Importing the jConnect classes

The classes in jConnect 6.0.5 are all in com.sybase.jdbc3.jdbc. You must import these classes at the beginning of each source file:

import com.sybase.jdbc3.jdbc.*
Encrypting passwords

SQL Anywhere supports password encryption for jConnect connections.


Installing jConnect system objects into a database
Loading the jConnect driver
Supplying a URL to the driver