At a command prompt, change to the samples-dir\SQLAnywhere\JDBC directory.
Start a database server with the sample database on your local computer using the following command:
dbeng11 samples-dir\demo.db |
Set the CLASSPATH environment variable.
set classpath=%classpath%;install-dir\java\jodbc.jar |
If you are using the jConnect driver instead, then use the following (where path is your jConnect installation directory):
set classpath=path\jConnect-6_0\classes\jconn3.jar;%classpath% |
Run the following command to compile the example:
javac JDBCConnect.java |
Run the following command to run the example:
java JDBCConnect |
Confirm that a list of identification numbers with customer's names appears at the command prompt.
If the attempt to connect fails, an error message appears instead. Confirm that you have executed all the steps as required. Check that your class path is correct. An incorrect setting may result in a failure to locate a class.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |