ASA Programming Guide
JDBC Programming
Establishing JDBC connections
Connecting from a JDBC client application using jConnect
This section describes how to run the external connection example.
To create and execute the external connection example application
Open the command prompt.
Change to your SQL Anywhere directory.
Change to the Samples\ASA\Java subdirectory.
Ensure the database is loaded onto a database server running TCP/IP. You can start such a server on your local machine using the following command (from the Samples\ASA\Java subdirectory):
start dbeng9 ..\..\..\asademo
Enter the following at the command prompt to run the example:
java JDBCExamples
If you wish to try this against a server running on another machine, you must enter the correct name of that machine. The default is localhost, which is an alias for the current machine name.
Confirm that a list of people and products 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 CLASSPATH is correct. An incorrect CLASSPATH results in a failure to locate a class.
For more information about using jConnect, see Using the jConnect JDBC driver, and see the online documentation for jConnect.