Protomatter Software v1.1.7

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:

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.
 
Constructor Summary
JdbcConnectionPoolDriver()
          Default constructor.
 
Method Summary
 boolean acceptsURL(java.lang.String url)
           
 java.sql.Connection connect(java.lang.String url, java.util.Properties props)
          Check a connection out of the pool specified in the URL.
 int getMajorVersion()
           
 int getMinorVersion()
           
static JdbcConnectionPool getPool(java.lang.String poolName)
          Get one of the currently registered JDBC Connection Pools.
static java.util.Iterator getPoolNames()
          Get the list of registered pool names.
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties props)
           
 boolean jdbcCompliant()
           
static void shutdownAllConnections()
          Shuts down all connections for all JDBC connection pools.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.
Constructor Detail

JdbcConnectionPoolDriver

public JdbcConnectionPoolDriver()
Default constructor.
Method Detail

getPool

public static JdbcConnectionPool getPool(java.lang.String poolName)
Get one of the currently registered JDBC Connection Pools.

getPoolNames

public static java.util.Iterator 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

Protomatter Software v1.1.7
Copyright 1998-2002 Nate Sammons

Protomatter Software v1.1.7 http://protomatter.sourceforge.net/1.1.7