Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Upgrade and Migration Guide

Establishing Connections Through the DriverManager Interface

Although this database access method is not recommended, as it is obsolete and is not very effective, there can be some applications that still use this approach.

In this case, the access code is similar to the following:

public static final String driver = "oracle.jdbc.driver.OracleDriver";
public static final String url = "jdbc:oracle:thin:tmb_user/tmb_user@iben:1521:tmbank";
Class.forName(driver).newInstance();
Properties props = new Properties();
props.setProperty("user", "tmb_user");
props.setProperty("password", "tmb_user");
Connection conn = DriverManager.getConnection(url, props);

This code can be fully ported from Application Server 6.x to Application Server, as long as the Application Server is able to locate the classes needed to load the right JDBC driver. In order to make the required classes accessible to the application deployed in the Application Server, place the archive (JAR or ZIP) for the driver implementation in the /lib directory of the Application Server installation directory.

Modify the CLASSPATH by setting the path for the driver through the Admin Console GUI.