|
SafeJDBC v2.00 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.safejdbc.api.Driver
public final class Driver
The Java SQL framework allows for multiple database drivers. Each driver should supply a class that implements the Driver interface
The DriverManager will try to load as many drivers as it can find and then for any given connection request, it will ask each driver in turn to try to connect to the target URL.
It is strongly recommended that each Driver class should be small and standalone so that the Driver class can be loaded and queried without bringing in vast quantities of supporting code.
When a Driver class is loaded, it should create an instance of itself and register it with the DriverManager. This means that a user can load and register a driver by doing Class.forName("foo.bah.Driver")
Driver| Constructor Summary | |
|---|---|
Driver()
Construct a new driver and register it with DriverManager |
|
| Method Summary | |
|---|---|
boolean |
acceptsURL(String url)
Retrieves whether the driver thinks that it can open a connection to the given URL. |
Connection |
connect(String url,
Properties info)
Try to make a database connection to the given URL. |
int |
getMajorVersion()
Gets the drivers major version number |
int |
getMinorVersion()
Get the drivers minor version number |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info)
The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database. |
boolean |
jdbcCompliant()
Report whether the driver is a genuine JDBC compliant driver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Driver()
throws SQLException
SQLException - if a SQL Exception occurs.| Method Detail |
|---|
public Connection connect(String url,
Properties info)
throws SQLException
The driver should raise an SQLException if it is the right driver to connect to the given URL, but has trouble connecting to the database.
The java.util.Properties argument can be used to pass arbitrary string tag/value pairs as connection arguments. Normally, at least "user" and "password" properties should be included in the properties.
connect in interface Driverurl - the URL of the database to connect toinfo - a list of arbitrary tag/value pairs as connection
arguments
SQLException - if a database access error occursDriver.connect(java.lang.String, java.util.Properties)
public boolean acceptsURL(String url)
throws SQLException
acceptsURL in interface Driverurl - the URL of the driver
SQLException - if a database-access error occurs
(Dont know why it would *shrug*)Driver.acceptsURL(java.lang.String)
public DriverPropertyInfo[] getPropertyInfo(String url,
Properties info)
throws SQLException
Note that depending on the values the human has supplied so far, additional values may become necessary, so it may be necessary to iterate through several calls to getPropertyInfo
getPropertyInfo in interface Driverurl - the Url of the database to connect toinfo - a proposed list of tag/value pairs that will be sent on
connect open.
SQLException - if a database-access error occursDriver.getPropertyInfo(java.lang.String, java.util.Properties)public int getMajorVersion()
getMajorVersion in interface Driverpublic int getMinorVersion()
getMinorVersion in interface Driverpublic boolean jdbcCompliant()
JDBC compliance requires full support for the JDBC API and full support for SQL 92 Entry Level.
For SafeJDBC, this is not yet possible, as we are not full SQL92 compliant (yet).
jdbcCompliant in interface Driver
|
SafeJDBC v2.00 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||