Save This Page
Home » apache-harmony-6.0-src-r917296-snapshot » java » sql » [javadoc | source]
java.sql
public class: DriverManager [javadoc | source]
java.lang.Object
   java.sql.DriverManager
Provides facilities for managing JDBC drivers.

The {@code DriverManager} class loads JDBC drivers during its initialization, from the list of drivers referenced by the system property {@code "jdbc.drivers"}.
Method from java.sql.DriverManager Summary:
deregisterDriver,   getConnection,   getConnection,   getConnection,   getDriver,   getDrivers,   getLogStream,   getLogWriter,   getLoginTimeout,   println,   registerDriver,   setLogStream,   setLogWriter,   setLoginTimeout
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.sql.DriverManager Detail:
 public static  void deregisterDriver(Driver driver) throws SQLException 
    Removes a driver from the {@code DriverManager}'s registered driver list. This will only succeed when the caller's class loader loaded the driver that is to be removed. If the driver was loaded by a different class loader, the removal of the driver fails silently.

    If the removal succeeds, the {@code DriverManager} will not use this driver in the future when asked to get a {@code Connection}.

 public static Connection getConnection(String url) throws SQLException 
    Attempts to establish a connection to the given database URL.
 public static Connection getConnection(String url,
    Properties info) throws SQLException 
    Attempts to establish a connection to the given database URL.
 public static Connection getConnection(String url,
    String user,
    String password) throws SQLException 
    Attempts to establish a connection to the given database URL.
 public static Driver getDriver(String url) throws SQLException 
    Tries to find a driver that can interpret the supplied URL.
 public static Enumeration<Driver> getDrivers() 
    Returns an {@code Enumeration} that contains all of the loaded JDBC drivers that the current caller can access.
 public static PrintStream getLogStream() 
Deprecated! use - #getLogWriter() instead.

    Gets the log {@code PrintStream} used by the {@code DriverManager} and all the JDBC Drivers.
 public static PrintWriter getLogWriter() 
    Retrieves the log writer.
 public static int getLoginTimeout() 
    Returns the login timeout when connecting to a database in seconds.
 public static  void println(String message) 
    Prints a message to the current JDBC log stream. This is either the {@code PrintWriter} or (deprecated) the {@code PrintStream}, if set.
 public static  void registerDriver(Driver driver) throws SQLException 
    Registers a given JDBC driver with the {@code DriverManager}.

    A newly loaded JDBC driver class should register itself with the {@code DriverManager} by calling this method.

 public static  void setLogStream(PrintStream out) 
Deprecated! Use - #setLogWriter instead.

    Sets the print stream to use for logging data from the {@code DriverManager} and the JDBC drivers.
 public static  void setLogWriter(PrintWriter out) 
    Sets the {@code PrintWriter} that is used by all loaded drivers, and also the {@code DriverManager}.
 public static  void setLoginTimeout(int seconds) 
    Sets the login timeout when connecting to a database in seconds.