org.jboss.minerva.datasource
Class PoolDriver

java.lang.Object
  |
  +--org.jboss.minerva.datasource.PoolDriver
All Implemented Interfaces:
java.sql.Driver

public class PoolDriver
extends java.lang.Object
implements java.sql.Driver

JDBC Driver to access pooled JDBC connections. Supports both JDBC 1.0 connections and JDBC 2.0 transactional XAConnections. You will get a java.sql.Connection back in any case (in the case of XAConnections, the transactional-ness is handled under the covers). You must create the pools ahead of time by creating and initializing the appropriate DataSource.

You should use a URL of the form jdbc:minerva:PoolName to get a connection from the pool. This will check for both a JDBC Pool and XA Pool if necessary, so don't create one pool of each type with the same name!

This driver will be loaded automatically whenever a JDBC Pool or XA Pool is created, but you can also use the standard Class.forName call to load it.

Version:
$Revision: 1.6 $
Author:
Aaron Mulder (ammulder@alumni.princeton.edu)
See Also:
JDBCPoolDataSource, XAPoolDataSource

Method Summary
 boolean acceptsURL(java.lang.String url)
          Tells which URLs this driver can handle.
 java.sql.Connection connect(java.lang.String url, java.util.Properties props)
          Retrieves a connection from a connection pool.
 int getMajorVersion()
          Returns the driver version.
 int getMinorVersion()
          Returns the driver version.
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
          Returns no properties.
static PoolDriver instance()
          Gets the singleton driver instance.
 boolean jdbcCompliant()
          Returns false since it is not known which underlying driver will be used and what its capabilities are.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static PoolDriver instance()
Gets the singleton driver instance.

acceptsURL

public boolean acceptsURL(java.lang.String url)
                   throws java.sql.SQLException
Tells which URLs this driver can handle.
Specified by:
acceptsURL in interface java.sql.Driver

connect

public java.sql.Connection connect(java.lang.String url,
                                   java.util.Properties props)
                            throws java.sql.SQLException
Retrieves a connection from a connection pool.
Specified by:
connect in interface java.sql.Driver

getMajorVersion

public int getMajorVersion()
Returns the driver version.
Specified by:
getMajorVersion in interface java.sql.Driver

getMinorVersion

public int getMinorVersion()
Returns the driver version.
Specified by:
getMinorVersion in interface java.sql.Driver

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
                                                     java.util.Properties info)
                                              throws java.sql.SQLException
Returns no properties. You do not need properties to connect to the pool, and the properties for the underlying driver are not managed here.
Specified by:
getPropertyInfo in interface java.sql.Driver

jdbcCompliant

public boolean jdbcCompliant()
Returns false since it is not known which underlying driver will be used and what its capabilities are.
Specified by:
jdbcCompliant in interface java.sql.Driver


Copyright © 2000 The jBoss Organization. All Rights Reserved.