| java.lang.Object | |
| ↳ | java.sql.DriverManager |
Provides facilities for managing JDBC Drivers.
The DriverManager class will load JDBC drivers during its initialization, from the list of drivers referenced by the System Property "jdbc.drivers".
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Removes a driver from the DriverManager's registered driver list.
| |||||||||||
Attempts to establish a connection to the given database URL.
| |||||||||||
Attempts to establish a connection to the given database URL.
| |||||||||||
Attempts to establish a connection to the given database URL.
| |||||||||||
Tries to find a driver that can interpret the supplied URL.
| |||||||||||
Returns an Enumeration that contains all of the loaded JDBC drivers that
the current caller can access.
| |||||||||||
This method is deprecated.
Gets the log PrintStream used by the DriverManager and all
the JDBC Drivers.
| |||||||||||
Retrieves the log writer.
| |||||||||||
Returns the login timeout when connecting to a database, in seconds.
| |||||||||||
Prints a message to the current JDBC log stream.
| |||||||||||
Registers a given JDBC driver with the DriverManager.
| |||||||||||
This method is deprecated.
Sets the Print Stream to use for logging data from the
DriverManager and the JDBC drivers.
Use setLogWriter(PrintWriter) instead. | |||||||||||
Sets the PrintWriter that will be used by all loaded drivers, and also
the DriverManager.
| |||||||||||
Set the login timeout when connecting to a database, in seconds.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
Removes a driver from the DriverManager's registered driver list. This will only succeed where the caller's classloader loaded the driver that is to be removed. If the driver was loaded by a different classloader, the removal of the driver will fail silently.
If the removal succeeds, the DriverManager will not in future use this driver when asked to get a Connection.
| SQLException | if there is an exception accessing the database. |
|---|
Attempts to establish a connection to the given database URL.
| url | a URL string representing the database target to connect with |
|---|---|
| user | a userid used to login to the database |
| password | a password for the userid to login to the database |
| SQLException | if there is an error while attempting to connect to the database identified by the URL |
|---|
Attempts to establish a connection to the given database URL.
| url | a URL string representing the database target to connect with |
|---|
| SQLException | if there is an error while attempting to connect to the database identified by the URL |
|---|
Attempts to establish a connection to the given database URL.
| url | a URL string representing the database target to connect with |
|---|---|
| info | a set of Properties to use as arguments to set up the connection. Properties are arbitrary string/value pairs. Normally, at least the properties "user" and "password" should be passed, with appropriate settings for the userid and its corresponding password to get access to the database concerned. |
| SQLException | if there is an error while attempting to connect to the database identified by the URL |
|---|
Tries to find a driver that can interpret the supplied URL.
| url | the URL of a database |
|---|
| SQLException | if there is any kind of Database Access problem |
|---|
Returns an Enumeration that contains all of the loaded JDBC drivers that the current caller can access.
This method is deprecated.Gets the log PrintStream used by the DriverManager and all the JDBC Drivers.
Retrieves the log writer.
Returns the login timeout when connecting to a database, in seconds.
Prints a message to the current JDBC log stream. This is either the PrintWriter or (deprecated) the PrintStream, if set.
| message | the message to print to the JDBC log stream |
|---|
Registers a given JDBC driver with the DriverManager.
A newly loaded JDBC driver class should register itself with the DriverManager by calling this method.
| driver | the Driver to register with the DriverManager |
|---|
| SQLException | if a database access error occurs. |
|---|
This method is deprecated.Sets the Print Stream to use for logging data from the DriverManager and the JDBC drivers.
Use setLogWriter(PrintWriter) instead.
| out | the PrintStream to use for logging. |
|---|
Sets the PrintWriter that will be used by all loaded drivers, and also the DriverManager.
| out | the PrintWriter to be used |
|---|
Set the login timeout when connecting to a database, in seconds.
| seconds | seconds until timeout. 0 indicates wait forever. |
|---|