Contents Index How the external connection example works Establishing a connection from a server-side JDBC class

ASA Programming Guide
  JDBC Programming
    Establishing JDBC connections
      Connecting from a JDBC client application using jConnect

Running the external connection example

This section describes how to run the external connection example.

To create and execute the external connection example application

  1. Open the command prompt.

  2. Change to your SQL Anywhere directory.

  3. Change to the Samples\ASA\Java subdirectory.

  4. 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
  5. 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.

  6. 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.


Contents Index How the external connection example works Establishing a connection from a server-side JDBC class