public final class JDBCDriverManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
addDriver(JDBCDriver driver)
Adds a new JDBC driver.
|
void |
addDriverListener(JDBCDriverListener listener)
Registers a JDBCDriverListener.
|
static JDBCDriverManager |
getDefault()
Gets the JDBCDriverManager singleton instance.
|
JDBCDriver[] |
getDrivers()
Gets the registered JDBC drivers.
|
JDBCDriver[] |
getDrivers(String drvClass)
Gets the registered JDBC drivers with the specified class name.
|
void |
removeDriver(JDBCDriver driver)
Removes a JDBC driver.
|
void |
removeDriverListener(JDBCDriverListener listener)
Unregisters the specified JDBCDriverListener.
|
void |
showAddDriverDialog()
Shows the Add Driver dialog, allowing the user to add a new JDBC driver.
|
JDBCDriver |
showAddDriverDialogFromEventThread()
Shows the Add Driver dialog synchronously.
|
public static JDBCDriverManager getDefault()
public JDBCDriver[] getDrivers()
public JDBCDriver[] getDrivers(String drvClass)
drvClass
- driver class name; must not be null.NullPointerException
- if the specified class name is null.public void addDriver(JDBCDriver driver) throws DatabaseException
driver
- the JDBCDriver instance describing the driver to be added;
must not be null.NullPointerException
- if the specified driver is null.
DatabaseException if an error occurred while adding the driver.DatabaseException
public void removeDriver(JDBCDriver driver) throws DatabaseException
driver
- the JDBCDriver instance to be removed.DatabaseException
- if an error occurred while adding the driver.public void showAddDriverDialog()
public JDBCDriver showAddDriverDialogFromEventThread()
IllegalStateException
- if the calling thread is not the event
dispatching thread.public void addDriverListener(JDBCDriverListener listener)
public void removeDriverListener(JDBCDriverListener listener)