Running the external connection example

This section describes how to run the external connection example

StepsCreating and executing the external connection example application

  1. From a system command prompt, change to the Sybase IQ installation directory.

  2. Change to the java subdirectory

  3. Ensure that your CLASSPATH environment variable includes the current directory (.) and the imported zip files. For example, from a command prompt (the following should be entered all on one line):

    set classpath=..\java\jdbcdrv.zip;.;..\java\asajdbc.zip;asademo.jar
    

    The default zip file name for Java is classes.zip. For classes in any file named classes.zip, you only need the directory name in the CLASSPATH variable, not the zip-file name itself. For classes in files with other names, you must supply the zip file name.

    You need the current directory in the CLASSPATH to run the example.

  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 /asa/java subdirectory):

    On UNIX: start_asiq .../asiqdemo

    On Windows: start_asiq ...\asiqdemo

  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 your 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 Sybase jConnect JDBC driver”, and see the online documentation for jConnect.