com.protomatter.jdbc.pool
Class JdbcConnectionPoolDriver
java.lang.Object
|
+--com.protomatter.jdbc.pool.JdbcConnectionPoolDriver
- All Implemented Interfaces:
- java.sql.Driver
- public class JdbcConnectionPoolDriver
- extends java.lang.Object
- implements java.sql.Driver
The driver for use with JDBC connection pools. When this
class is loaded, it registers itself with the DriverManager.
This driver accepts JDBC connection URLs of the form:
jdbc:protomatter:pool:PoolName
This class also keeps a static reference to the list of all
known connection pools, which is updated by creating a new
JdbcConnectionPool object. Pools can be un-registered by
calling unRegisterPool() on the JdbcConnectionPool
object.
- See Also:
java.sql.DriverManager
,
JdbcConnectionPool
,
JdbcConnectionPoolConnection
Field Summary |
static java.lang.String |
URL_PREFIX
The JDBC URL prefix for making connections. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URL_PREFIX
public static java.lang.String URL_PREFIX
- The JDBC URL prefix for making connections. The poolname
should be appended to this string when asking for
connections from the DriverManager.
JdbcConnectionPoolDriver
public JdbcConnectionPoolDriver()
- Default constructor.
getPool
public static JdbcConnectionPool getPool(java.lang.String poolName)
- Get one of the currently registered JDBC Connection Pools.
getPoolNames
public static java.util.Enumeration getPoolNames()
- Get the list of registered pool names. The returned enumeration
contains strings.
shutdownAllConnections
public static void shutdownAllConnections()
- Shuts down all connections for all JDBC connection pools.
This should only be used as part of a system shutdown of
some kind. All pools are un-registered when this
method is run.
- See Also:
JdbcConnectionPool.closeAllConnections()
connect
public java.sql.Connection connect(java.lang.String url,
java.util.Properties props)
throws java.sql.SQLException
- Check a connection out of the pool specified in the URL.
- Specified by:
connect
in interface java.sql.Driver
- Throws:
java.sql.SQLException
- If there is a problem checking a connection out of the pool.- See Also:
Driver
acceptsURL
public boolean acceptsURL(java.lang.String url)
throws java.sql.SQLException
- Specified by:
acceptsURL
in interface java.sql.Driver
- Throws:
java.sql.SQLException
- Because java.sql.Driver throws one here.- See Also:
Driver
getPropertyInfo
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
java.util.Properties props)
throws java.sql.SQLException
- Specified by:
getPropertyInfo
in interface java.sql.Driver
- Throws:
java.sql.SQLException
- Because java.sql.Driver throws one here.- See Also:
Driver
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion
in interface java.sql.Driver
- See Also:
Driver
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion
in interface java.sql.Driver
- See Also:
Driver
jdbcCompliant
public boolean jdbcCompliant()
- Specified by:
jdbcCompliant
in interface java.sql.Driver
- See Also:
Driver