Invoking the jConnect Driver

Register and invoke jConnect, and add jConnect to the jdbc.drivers system property.

At initialization, the DriverManager class attempts to load the drivers listed in jdbc.drivers. This is less efficient than calling Class.forName. You can list multiple drivers in this property, separated with a colon (:).

This sample code shows how to add a driver tojdbc.drivers within a program:
Properties sysProps = System.getProperties();
String drivers = "com.sybase.jdbc4.jdbc.SybDriver";
String oldDrivers =
sysProps.getProperty("jdbc.drivers");
if (oldDrivers != null)
   drivers += ":" + oldDrivers;
 sysProps.put("jdbc.drivers", drivers.toString());
Note: You cannot use System.getProperties for Java applets. Use the Class.forName method instead.
In Java 6 and JDBC 4, you can use the Java system property jdbc.drivers to specify driver classes, for example:
java -Djdbc.drivers=com.sybase.jdbc4.jdbc.SybDriver UseDriver
You need not use the UseDriver program to load the driver explicitly:
public class UseDriver
{
   public static void main(String[] args)
   {
      try {
         Connection conn = java.sql.DriverManager.getConnection
            ("jdbc:sybase:Tds:localhost:5000?USER=sa&PASSWORD=secret");
         // more code to use connection ...
      }
      catch (SQLException se){
         System.out.println("ERROR: SQLException "+se);
      }
   }
}