|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--superwaba.ext.xplat.sql.DriverManager
This class manages the JDBC drivers in the system. It maintains a registry of drivers and locates the appropriate driver to handle a JDBC database URL.
On startup, DriverManager
loads all the managers specified
by the system property jdbc.drivers
. The value of this
property should be a colon separated list of fully qualified driver
class names. Additional drivers can be loaded at any time by
simply loading the driver class with class.forName(String)
.
The driver should automatically register itself in a static
initializer.
The methods in this class are all static
. This class
cannot be instantiated.
Method Summary | |
static void |
deregisterDriver(Driver driver)
This method de-registers a driver from the manager. |
static Connection |
getConnection(String url)
This method attempts to return a connection to the specified JDBC URL string. |
static Connection |
getConnection(String url,
Hashtable properties)
This method attempts to return a connection to the specified JDBC URL string using the specified connection properties. |
static Connection |
getConnection(String url,
String user,
String password)
This method attempts to return a connection to the specified JDBC URL string using the specified username and password. |
static Driver |
getDriver(String url)
This method returns a driver that can connect to the specified JDBC URL string. |
static Vector |
getDrivers()
This method returns a list of all the currently registered JDBC drivers. |
static int |
getLoginTimeout()
This method returns the login timeout in use by JDBC drivers systemwide. |
static void |
registerDriver(Driver driver)
This method registers a new driver with the manager. |
static void |
setLoginTimeout(int seconds)
This method set the login timeout used by JDBC drivers. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Method Detail |
public static Connection getConnection(String url, Hashtable properties) throws SQLException
url
- The JDBC URL string to connect to.properties
- The connection properties.Connection
to that URL.public static Connection getConnection(String url, String user, String password) throws SQLException
url
- The JDBC URL string to connect to.user
- The username to connect with.password
- The password to connect with.Connection
to that URL.public static Connection getConnection(String url) throws SQLException
url
- The JDBC URL string to connect to.Connection
to that URL.public static Driver getDriver(String url) throws SQLException
url
- The JDBC URL string to find a driver for.Driver
that can connect to the specified
URL, or null
if a suitable driver cannot be found.public static void registerDriver(Driver driver) throws SQLException
driver
- The new Driver
to add.public static void deregisterDriver(Driver driver) throws SQLException
driver
- The Driver
to unregister.public static Vector getDrivers()
Vector
of all currently loaded JDBC drivers.public static void setLoginTimeout(int seconds)
login_timeout
- The new login timeout value.public static int getLoginTimeout()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |