Contents Index Loading the jConnect driver Specifying a database on a server

ASA Programming Guide
  JDBC Programming
    Using the jConnect JDBC driver

Supplying a URL for the server


To connect to a database via jConnect, you need to supply a Uniform Resource Locator (URL) for the database. An example given in the section Connecting from a JDBC client application using jConnect is as follows:

StringBuffer temp = new StringBuffer();
// Use the jConnect driver...
temp.append("jdbc:sybase:Tds:");
// to connect to the supplied machine name...
temp.append(_coninfo);
// on the default port number for ASA...
temp.append(":2638");
// and connect.
System.out.println(temp.toString());
conn = DriverManager.getConnection(temp.toString() , _props );

The URL is put together in the following way:

jdbc:sybase:Tds:machine-name:port-number

The individual components are:

The connection string must be less than 253 characters in length.


Specifying a database on a server
Database options set for jConnect connections

Contents Index Loading the jConnect driver Specifying a database on a server