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

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

Server-side connection example code

The following is the source code for the example. You can find the source code in the InternalConnect method of Samples\ASA\Java\JDBCExamples.java under your SQL Anywhere directory:

public static void InternalConnect() {
  try {
      conn = DriverManager.getConnection("jdbc:default:connection");
      System.out.println("Hello World");
    }
    catch ( Exception e ) {
      System.out.println("Error: " + e.getMessage());
      e.printStackTrace();
    }
  }
}

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