O'Reilly logo

Database Programming with JDBC & Java, Second Edition by George Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

DriverManager

Synopsis

Class Name: java.sql.DriverManager

Superclass: None

Immediate Subclasses: None

Interfaces Implemented: None

Availability: JDK 1.1

Description

The DriverManager holds the master list of registered JDBC drivers for the system. Upon initialization, it loads all classes specified in the jdbc.drivers property. You can thus specify any runtime information about the database being used by an application on the command line.

During program execution, other drivers may register themselves with the DriverManager by calling the registerDriver( ) method. The DriverManager uses a JDBC URL to find an application’s desired driver choice when requests are made through getConnection( ).

The DriverManager class is likely to disappear one day as the new JDBC 2.0 Standard Extension provides a more application-friendly way of getting a database connection.

Class Summary

public class DriverManager {
    static void deregisterDriver(Driver driver) 
        throws SQLException;
    static public synchronized Connection getConnection(String url, 
        Properties info) throws SQLException;
    static public synchronized Connection getConnection(String url,
        String user, String password) throws SQLException;
    static public synchronized Connection getConnection(String url) 
        throws SQLException;
     static public Driver getDriver(String url) throws SQLException;
    static public Enumeration getDrivers( );
    static public int getLoginTimeout( );
    #static public PrintStream getLogStream( );
    static public PrintWriter getLogWriter( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required