com.metamatrix.common.jdbc
Class SimplePooledConnectionSource

java.lang.Object
  extended by com.metamatrix.common.jdbc.SimplePooledConnectionSource
All Implemented Interfaces:
java.sql.Wrapper, javax.sql.CommonDataSource, javax.sql.DataSource

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

Simple pooling built on JDBCUtil. Not compatible with DataSources, etc. Added due to poor 1.6 support among common connection pool implementations. TODO: Should be switched to proxool or some implementation


Field Summary
static java.lang.String MAXIMUM_RESOURCE_POOL_SIZE
           
static java.lang.String RESOURCE_TEST_INTERVAL
           
static java.lang.String WAIT_TIME_FOR_RESOURCE
           
 
Constructor Summary
SimplePooledConnectionSource(java.util.Properties p)
           
 
Method Summary
protected  java.sql.Connection createConnection()
           
 java.sql.Connection getConnection()
           
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
           
 int getLoginTimeout()
           
 java.io.PrintWriter getLogWriter()
           
 boolean isWrapperFor(java.lang.Class<?> arg0)
           
 void setLoginTimeout(int arg0)
           
 void setLogWriter(java.io.PrintWriter arg0)
           
 void shutDown()
           
<T> T
unwrap(java.lang.Class<T> arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAIT_TIME_FOR_RESOURCE

public static final java.lang.String WAIT_TIME_FOR_RESOURCE
See Also:
Constant Field Values

MAXIMUM_RESOURCE_POOL_SIZE

public static final java.lang.String MAXIMUM_RESOURCE_POOL_SIZE
See Also:
Constant Field Values

RESOURCE_TEST_INTERVAL

public static final java.lang.String RESOURCE_TEST_INTERVAL
See Also:
Constant Field Values
Constructor Detail

SimplePooledConnectionSource

public SimplePooledConnectionSource(java.util.Properties p)
Method Detail

getConnection

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

createConnection

protected java.sql.Connection createConnection()
                                        throws MetaMatrixException
Throws:
MetaMatrixException

shutDown

public void shutDown()

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.CommonDataSource
Throws:
java.sql.SQLException

getLoginTimeout

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

setLogWriter

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

setLoginTimeout

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

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> arg0)
                     throws java.sql.SQLException
Specified by:
isWrapperFor in interface java.sql.Wrapper
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> arg0)
         throws java.sql.SQLException
Specified by:
unwrap in interface java.sql.Wrapper
Throws:
java.sql.SQLException


Copyright © 2009. All Rights Reserved.