ASA Programming Guide
JDBC Programming
JDBC overview
A difference between JDBC on the client and in the database server lies in establishing a connection with the database environment.
Client side In client-side JDBC, establishing a connection requires the Sybase jConnect JDBC driver or the iAnywhere JDBC driver. Passing arguments to the DriverManager.getConnection establishes the connection. The database environment is an external application from the perspective of the client application.
Server-side When using JDBC within the database server, a connection already exists. A value of jdbc:default:connection passes to DriverManager.getConnection, which provides the JDBC application with the ability to work within the current user connection. This is a quick, efficient, and safe operation because the client application has already passed the database security to establish the connection. The user ID and password, having been provided once, do not need to be provided again. The internal JDBC driver can only connect to the database of the current connection.
You can write JDBC classes in such a way that they can run both at the client and at the server by employing a single conditional statement for constructing the URL. An external connection requires the machine name and port number, while the internal connection requires jdbc:default:connection.