<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.sql.DriverManager
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.sql.html">This Package</a>  <a href="java.sql.Date.html#_top_">Previous</a>  <a href="java.sql.DriverPropertyInfo.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.sql.DriverManager
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.sql.DriverManager
</pre>
<hr>
<dl>
  <dt> public class <b>DriverManager</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
<P>The DriverManager provides a basic service for managing a set of
 JDBC drivers.
 <P>As part of its initialization, the DriverManager class will
 attempt to load the driver classes referenced in the "jdbc.drivers"
 system property. This allows a user to customize the JDBC Drivers
 used by their applications. For example in your
 ~/.hotjava/properties file you might specify:
 <CODE>jdbc.drivers=foo.bah.Driver:wombat.sql.Driver:bad.taste.ourDriver</CODE>
 A program can also explicitly load JDBC drivers at any time. For
 example, the my.sql.Driver is loaded with the following statement:
 <CODE>Class.forName("my.sql.Driver");</CODE>
 <P>When getConnection is called the DriverManager will attempt to
 locate a suitable driver from amongst those loaded at
 initialization and those loaded explicitly using the same classloader
 as the current applet or application.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.sql.Driver.html#_top_">Driver</a>, <a href="java.sql.Connection.html#_top_">Connection</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#deregisterDriver(java.sql.Driver)"><b>deregisterDriver</b></a>(Driver)
  <dd>  Drop a Driver from the DriverManager's list.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getConnection(java.lang.String)"><b>getConnection</b></a>(String)
  <dd>  Attempt to establish a connection to the given database URL.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getConnection(java.lang.String, java.util.Properties)"><b>getConnection</b></a>(String, Properties)
  <dd>  Attempt to establish a connection to the given database URL.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getConnection(java.lang.String, java.lang.String, java.lang.String)"><b>getConnection</b></a>(String, String, String)
  <dd>  Attempt to establish a connection to the given database URL.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDriver(java.lang.String)"><b>getDriver</b></a>(String)
  <dd>  Attempt to locate a driver that understands the given URL.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDrivers()"><b>getDrivers</b></a>()
  <dd>  Return an Enumeration of all the currently loaded JDBC drivers
 which the current caller has access to.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLoginTimeout()"><b>getLoginTimeout</b></a>()
  <dd>  Get the maximum time in seconds that all drivers can wait
 when attempting to log in to a database.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLogStream()"><b>getLogStream</b></a>()
  <dd>  Get the logging/tracing PrintStream that is used by the DriverManager
 and all drivers.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#println(java.lang.String)"><b>println</b></a>(String)
  <dd>  Print a message to the current JDBC log stream

 
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#registerDriver(java.sql.Driver)"><b>registerDriver</b></a>(Driver)
  <dd>  A newly loaded driver class should call registerDriver to make itself
 known to the DriverManager.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setLoginTimeout(int)"><b>setLoginTimeout</b></a>(int)
  <dd>  Set the maximum time in seconds that all drivers can wait
 when attempting to log in to a database.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setLogStream(java.io.PrintStream)"><b>setLogStream</b></a>(PrintStream)
  <dd>  Set the logging/tracing PrintStream that is used by the DriverManager
 and all drivers.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getConnection(java.lang.String, java.util.Properties)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getConnection"><b>getConnection</b></a>
<pre>
 public static synchronized <a href="java.sql.Connection.html#_top_">Connection</a> getConnection(<a href="java.lang.String.html#_top_">String</a> url,
                                                     <a href="java.util.Properties.html#_top_">Properties</a> info) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Attempt to establish a connection to the given database URL.
 The DriverManager attempts to select an appropriate driver from
 the set of registered JDBC drivers.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> url - a database url of the form jdbc:<em>subprotocol</em>:<em>subname</em>
    <dd> info - a list of arbitrary string tag/value pairs as
 connection arguments; normally at least a "user" and
 "password" property should be included
    <dt> <b>Returns:</b>
    <dd> a Connection to the URL
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getConnection(java.lang.String, java.lang.String, java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getConnection"><b>getConnection</b></a>
<pre>
 public static synchronized <a href="java.sql.Connection.html#_top_">Connection</a> getConnection(<a href="java.lang.String.html#_top_">String</a> url,
                                                     <a href="java.lang.String.html#_top_">String</a> user,
                                                     <a href="java.lang.String.html#_top_">String</a> password) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Attempt to establish a connection to the given database URL.
 The DriverManager attempts to select an appropriate driver from
 the set of registered JDBC drivers.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> url - a database url of the form jdbc:<em>subprotocol</em>:<em>subname</em>
    <dd> user - the database user on whose behalf the Connection is being made
    <dd> password - the user's password
    <dt> <b>Returns:</b>
    <dd> a Connection to the URL
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getConnection(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getConnection"><b>getConnection</b></a>
<pre>
 public static synchronized <a href="java.sql.Connection.html#_top_">Connection</a> getConnection(<a href="java.lang.String.html#_top_">String</a> url) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Attempt to establish a connection to the given database URL.
 The DriverManager attempts to select an appropriate driver from
 the set of registered JDBC drivers.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> url - a database url of the form jdbc:<em>subprotocol</em>:<em>subname</em>
    <dt> <b>Returns:</b>
    <dd> a Connection to the URL
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getDriver(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDriver"><b>getDriver</b></a>
<pre>
 public static <a href="java.sql.Driver.html#_top_">Driver</a> getDriver(<a href="java.lang.String.html#_top_">String</a> url) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Attempt to locate a driver that understands the given URL.
 The DriverManager attempts to select an appropriate driver from
 the set of registered JDBC drivers.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> url - a database url of the form jdbc:<em>subprotocol</em>:<em>subname</em>
    <dt> <b>Returns:</b>
    <dd> a Driver that can connect to the URL
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="registerDriver(java.sql.Driver)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="registerDriver"><b>registerDriver</b></a>
<pre>
 public static synchronized void registerDriver(<a href="java.sql.Driver.html#_top_">Driver</a> driver) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> A newly loaded driver class should call registerDriver to make itself
 known to the DriverManager.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> driver - the new JDBC Driver
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="deregisterDriver(java.sql.Driver)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="deregisterDriver"><b>deregisterDriver</b></a>
<pre>
 public static void deregisterDriver(<a href="java.sql.Driver.html#_top_">Driver</a> driver) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Drop a Driver from the DriverManager's list.  Applets can only
 deregister Drivers from their own classloader.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> driver - the JDBC Driver to drop
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getDrivers()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDrivers"><b>getDrivers</b></a>
<pre>
 public static <a href="java.util.Enumeration.html#_top_">Enumeration</a> getDrivers()
</pre>
<dl>
  <dd> Return an Enumeration of all the currently loaded JDBC drivers
 which the current caller has access to.
 <P><B>Note:</B> The classname of a driver can be found using
 <CODE>d.getClass().getName()</CODE>
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the list of JDBC Drivers loaded by the caller's class loader
  </dl></dd>
</dl>
<a name="setLoginTimeout(int)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setLoginTimeout"><b>setLoginTimeout</b></a>
<pre>
 public static void setLoginTimeout(int seconds)
</pre>
<dl>
  <dd> Set the maximum time in seconds that all drivers can wait
 when attempting to log in to a database.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> seconds - the driver login time limit
  </dl></dd>
</dl>
<a name="getLoginTimeout()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLoginTimeout"><b>getLoginTimeout</b></a>
<pre>
 public static int getLoginTimeout()
</pre>
<dl>
  <dd> Get the maximum time in seconds that all drivers can wait
 when attempting to log in to a database.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the driver login time limit
  </dl></dd>
</dl>
<a name="setLogStream(java.io.PrintStream)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setLogStream"><b>setLogStream</b></a>
<pre>
 public static void setLogStream(<a href="java.io.PrintStream.html#_top_">PrintStream</a> out)
</pre>
<dl>
  <dd> Set the logging/tracing PrintStream that is used by the DriverManager
 and all drivers.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> out - the new logging/tracing PrintStream; to disable, set to null
  </dl></dd>
</dl>
<a name="getLogStream()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLogStream"><b>getLogStream</b></a>
<pre>
 public static <a href="java.io.PrintStream.html#_top_">PrintStream</a> getLogStream()
</pre>
<dl>
  <dd> Get the logging/tracing PrintStream that is used by the DriverManager
 and all drivers.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the logging/tracing PrintStream; if disabled, is null
  </dl></dd>
</dl>
<a name="println(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="println"><b>println</b></a>
<pre>
 public static void println(<a href="java.lang.String.html#_top_">String</a> message)
</pre>
<dl>
  <dd> Print a message to the current JDBC log stream
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> message - a log or tracing message
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.sql.html">This Package</a>  <a href="java.sql.Date.html#_top_">Previous</a>  <a href="java.sql.DriverPropertyInfo.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
