JDBC Reference
Page 3 of 31

java.sql.Driver

JDBC provides different ways to load a driver, listed below.

Embedded Databases

The class that loads Cloudscape's local JDBC driver is the class COM.cloudscape.core.JDBCDriver. Some of the ways listed below create instances of the Cloudscape driver class. Do not use the class directly via the java.sql.Driver interface. Use the DriverManager class to create connections.

  • Class.forName("COM.cloudscape.core.JDBCDriver")

    The manner recommended by JavaSoft. However, some JVMs may not load the class when it is accessed. They can delay until instances of the class are created.

    For example, this method doesn't work on AIX. Instead, use:

    Class.forName("COM.cloudscape.core.JDBCDriver").newInstance()

    Adding the newInstance() method guarantees that the Cloudscape system will be booted in all JVMs.

  • Class.forName("COM.cloudscape.core.JDBCDriver").newInstance()

    Our recommended manner, because it ensures that the class is loaded in all JVMs by creating an instance at the same time.

  • new COM.cloudscape.core.JDBCDriver()

    Same as Class.forName("COM.cloudscape.core.JDBCDriver").newInstance(), except that it requires the class to be found when the code is compiled.

  • Class c = COM.cloudscape.core.JDBCDriver.class

    This is the same as Class.forName("COM.cloudscape.core.JDBCDriver"), except that it requires the class to be found when the code is compiled. The pseudo-static field class evaluates to the class that is named.

  • Setting the System property jdbc.drivers

    To set a System property, you alter the invocation command line or the system properties within your application. It is not possible to alter system properties within an applet.

    An invocation of the JDK JVM:

java -Djdbc.drivers=COM.cloudscape.core.JDBCDriver
    applicationClass

The actual driver that gets registered in the DriverManager to handle the jdbc:cloudscape: protocol is not the class COM.cloudscape.core.JDBCDriver; that class simply detects the type of Cloudscape driver needed and then causes the appropriate Cloudscape driver to be loaded.

The only supported way to connect to a Cloudscape system through the jdbc:cloudscape: protocol is using the DriverManager to obtain a driver (java.sql.Driver) or connection (java.sql.Connection) through the getDriver and getConnection method calls.

Cloudconnector

For clients to Cloudconnector, you load the client JDBC driver with the class COM.cloudscape.core.WebLogicDriver in the same manner as that prescribed for an embedded environment. See the Cloudscape Server and Administration Guide for more information.

RmiJdbc

For clients to the RmiJdbc server, you load the client JDBC driver with the class COM.cloudscape.core.RmiJdbcDriver in the same manner as that prescribed for an embedded environment. See the Cloudscape Server and Administration Guide for more information.