nl.knowledgeplaza.util.pool
Class JdbcConnectionPoolDataSource

java.lang.Object
  extended by nl.knowledgeplaza.util.pool.JdbcConnectionPoolDataSource
All Implemented Interfaces:
javax.sql.DataSource

public class JdbcConnectionPoolDataSource
extends java.lang.Object
implements javax.sql.DataSource

This class implements a DataSource on top of the JdbcConnectionPool

Version:
$Revision: 1.3 $

Field Summary
static org.apache.log4j.Logger log4j
           
static java.lang.String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
JdbcConnectionPoolDataSource(ObjectPool objectPool)
           
 
Method Summary
 java.sql.Connection getConnection()
          This method fetches a connection from the pool, and wraps it in a pooled connection, so it is returned to the pool upon close.
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
           
 int getLoginTimeout()
           
 java.io.PrintWriter getLogWriter()
           
 boolean isWrapperFor(java.lang.Class<?> iface)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(java.io.PrintWriter out)
           
<T> T
unwrap(java.lang.Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final java.lang.String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values

log4j

public static org.apache.log4j.Logger log4j
Constructor Detail

JdbcConnectionPoolDataSource

public JdbcConnectionPoolDataSource(ObjectPool objectPool)
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
This method fetches a connection from the pool, and wraps it in a pooled connection, so it is returned to the pool upon close.

Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection(java.lang.String username,
                                         java.lang.String password)
                                  throws java.sql.SQLException
Specified by:
getConnection in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Specified by:
getLogWriter in interface javax.sql.DataSource
Throws:
java.sql.SQLException

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws java.sql.SQLException
Specified by:
setLogWriter in interface javax.sql.DataSource
Throws:
java.sql.SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws java.sql.SQLException
Specified by:
setLoginTimeout in interface javax.sql.DataSource
Throws:
java.sql.SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Specified by:
getLoginTimeout in interface javax.sql.DataSource
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2010. All Rights Reserved.