Contents Index Server-side connection example code Running the server-side connection example

ASA Programming Guide
  JDBC Programming
    Establishing JDBC connections
      Establishing a connection from a server-side JDBC class

How the server-side connection example works

In this simple example, InternalConnect() is the only method used in the application.

The application requires only one of the libraries (JDBC) imported in the first line of the JDBCExamples.java class. The others are for external connections. The package named java.sql contains the JDBC classes.

The InternalConnect() method carries out the following tasks:

  1. Connects to the default running database using the current connection:

  2. Prints Hello World to the current standard output, which is the server window. System.out.println carries out the printing.

  3. If there is an error in the attempt to connect, an error message appears in the server window, together with the place where the error occurred.

    The try and catch instructions provide the framework for the error handling.

  4. Terminates the class.


Contents Index Server-side connection example code Running the server-side connection example