All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class nl.nmg.sql.PoolDriver

java.lang.Object
   |
   +----nl.nmg.sql.PoolDriver

public class PoolDriver
extends Object
implements Driver
The PoolDriver handles JDBC URLs that start with "jdbc:pool:" and are followed by another JDBC URL, e.g. jdbc:pool:jdbc:odbc:SampleTable and calls PoolDriverManager.getConnection() to get a pool connection for the encapsulated JDBC URL.

For example, the following code samples do the same.

 DriverManager.registerDriver(new PoolDriver());
 conn = DriverManager.getConnection("jdbc:pool:jdbc:odbc:SampleTable");
 
and
 conn = PoolDriverManager.getConnection("jdbc:odbc:SampleTable");
 

See Also:
PoolDriverManager, Driver

Constructor Index

 o PoolDriver()
Creates an instance of the pool driver.

Method Index

 o acceptsURL(String)
Return true if the PoolDriver can do something with this.
 o connect(String, Properties)
Open or reuse a proxy connection to the specified URL.
 o getMajorVersion()
Gets the drivers major version number
 o getMinorVersion()
Get the drivers minor version number
 o getPropertyInfo(String, Properties)
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.
 o jdbcCompliant()
Report whether the driver is a genuine JDBC compliant driver.

Constructors

 o PoolDriver
 public PoolDriver() throws SQLException
Creates an instance of the pool driver. The static initializer takes care of registering the driver with the driver manager.

Throws: SQLException
never

Methods

 o acceptsURL
 public boolean acceptsURL(String url) throws SQLException
Return true if the PoolDriver can do something with this.

Parameters:
url - the URL of the database to connect to
Throws: SQLException
never
 o connect
 public Connection connect(String url,
                           Properties info) throws SQLException
Open or reuse a proxy connection to the specified URL.

Parameters:
url - the URL of the database to connect to
info - connection properties
Throws: SQLException
when PoolDriverManager.getConnection() throws an exception
 o getPropertyInfo
 public DriverPropertyInfo[] getPropertyInfo(String url,
                                             Properties info) throws SQLException
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.

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

Parameters:
url - the Url of the database to connect to
info - a proposed list of tag/value pairs that will be sent on connect open.
Returns:
An array of DriverPropertyInfo objects describing possible properties. This array may be an empty array if no properties are required
Throws: SQLException
never
See Also:
getPropertyInfo
 o getMajorVersion
 public int getMajorVersion()
Gets the drivers major version number

Returns:
the drivers major version number
 o getMinorVersion
 public int getMinorVersion()
Get the drivers minor version number

Returns:
the drivers minor version number
 o jdbcCompliant
 public boolean jdbcCompliant()
Report whether the driver is a genuine JDBC compliant driver. A driver may only report "true" here if it passes the JDBC compliance tests, otherwise it is required to return false. JDBC compliance requires full support for the JDBC API and full support for SQL 92 Entry Level.

The PoolDriver does not know if the real driver used is JDBC compliant, the safest answer is false.


All Packages  Class Hierarchy  This Package  Previous  Next  Index