Contents Index External connection example code Running the external connection example

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

How the external connection example works

The external connection example is a Java command-line application.

Importing packages 

The application requires several libraries, which are imported in the first lines of JDBCExamples.java:

The main method 

Each Java application requires a class with a method named main, which is the method invoked when the program starts. In this simple example, JDBCExamples.main is the only public method in the application.

The JDBCExamples.main method carries out the following tasks:

  1. Processes the command-line argument, using the machine name if supplied. By default, the machine name is localhost, which is appropriate for the personal database server.

  2. Calls the ASAConnect method to establish a connection.

  3. Executes several methods that scroll data to your command-line.

The ASAConnect method 

The JDBCExamples.ASAConnect method carries out the following tasks:

  1. Connects to the default running database using Sybase jConnect.

  2. Returns control to the calling method.


Contents Index External connection example code Running the external connection example