ASA Programming Guide
JDBC Programming
Using the jConnect JDBC driver
The jConnect JDBC driver is installed into a set of directories under the Sybase\Shared directory. Two versions of jConnect are supplied:
jConnect 4.5 This version of jConnect is for use when developing JDK 1.1 applications. jConnect 4.5 is installed into the Sybase\Shared\jConnect-4_5 directory.
jConnect 4.5 is supplied as a set of classes.
jConnect 5.5 This version of jConnect is for use when developing JDK 1.2 or later applications. jConnect 5.5 is installed into the Sybase\Shared\jConnect-5_5 directory.
jConnect 5.5 is supplied as a jar file named jconn2.jar.
Examples in this chapter use jConnect 5.5. Users of jConnect 4.5 must make appropriate substitutions.
For your application to use jConnect, the jConnect classes must be in your classpath at compile time and run time, so the Java compiler and Java runtime can locate the necessary files.
The following command adds the jConnect 5.5 driver to an existing CLASSPATH environment variable where path is your Sybase\Shared directory.
set classpath=%classpath%;path\jConnect-5_5\classes\jconn2.jar
The following command adds the jConnect 4.5 driver to an existing CLASSPATH environment variable:
set classpath=%classpath%;path\jConnect-4_5\classes
The classes in jConnect are all in the com.sybase package.
If you are using jConnect 5.5, your application must access classes in com.sybase.jdbc2.jdbc. You must import these classes at the beginning of each source file:
import com.sybase.jdbc2.jdbc.*
If you are using jConnect 4.5, the classes are in com.sybase.jdbc. You must import these classes at the beginning of each source file:
import com.sybase. jdbc.*