Protomatter Classes v1.1.6

com.protomatter.jdbc.pool
Class JdbcConnectionPoolDataSource

java.lang.Object
  |
  +--com.protomatter.jdbc.pool.JdbcConnectionPoolDataSource
All Implemented Interfaces:
javax.sql.ConnectionPoolDataSource, javax.sql.DataSource

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

An implementation of the javax.sql.DataSource and javax.sql.ConnectionPoolDataSource interfaces.

See Also:
DataSource, ConnectionPoolDataSource, JdbcConnectionPool, JdbcConnectionPoolDriver, JdbcConnectionPoolConnection

Constructor Summary
JdbcConnectionPoolDataSource(java.lang.String poolName)
          Create a new DataSource attached to the given JDBC connection pool.
 
Method Summary
 java.sql.Connection getConnection()
          Get a connection from this DataSource.
 java.sql.Connection getConnection(java.lang.String user, java.lang.String password)
          Get a connection from this DataSource.
 int getLoginTimeout()
          Get the login timeout.
 java.io.PrintWriter getLogWriter()
          Get the log writer.
 javax.sql.PooledConnection getPooledConnection()
          Get a PooledConnection from this ConnectionPoolDataSource.
 javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password)
          Get a PooledConnection from this ConnectionPoolDataSource.
 void setLoginTimeout(int loginTimeout)
          Set the login timeout (in seconds).
 void setLogWriter(java.io.PrintWriter logWriter)
          Set the log writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcConnectionPoolDataSource

public JdbcConnectionPoolDataSource(java.lang.String poolName)
                             throws java.sql.SQLException
Create a new DataSource attached to the given JDBC connection pool. The pool must already exist.
See Also:
JdbcConnectionPool
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Get a connection from this DataSource. If the login timeout has been set to zero, this method will block indefinately. If the timeout has been set to something other than zero, this method is guaranteed to return (or throw a SQLException) within the specified time period.
Specified by:
getConnection in interface javax.sql.DataSource
See Also:
DataSource

getConnection

public java.sql.Connection getConnection(java.lang.String user,
                                         java.lang.String password)
                                  throws java.sql.SQLException
Get a connection from this DataSource. The user and password are ignored. If the login timeout has been set to zero, this method will block indefinately. If the timeout has been set to something other than zero, this method is guaranteed to return (or throw a SQLException) within the specified time period.
Specified by:
getConnection in interface javax.sql.DataSource
See Also:
DataSource

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Get the log writer.
Specified by:
getLogWriter in interface javax.sql.DataSource
See Also:
DataSource

setLogWriter

public void setLogWriter(java.io.PrintWriter logWriter)
                  throws java.sql.SQLException
Set the log writer.
Specified by:
setLogWriter in interface javax.sql.DataSource
See Also:
DataSource

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Get the login timeout. The value specified is in seconds.
Specified by:
getLoginTimeout in interface javax.sql.DataSource
See Also:
DataSource

setLoginTimeout

public void setLoginTimeout(int loginTimeout)
                     throws java.sql.SQLException
Set the login timeout (in seconds). If this value is set to something other than zero, any method that gets a connection is guaranteed to return (or throw a SQLException) within the specified amount of time. If this value is set to zero, any method that gets a connection will block indefinately until a connection is available. The default value is zero.
Specified by:
setLoginTimeout in interface javax.sql.DataSource
See Also:
DataSource

getPooledConnection

public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
Get a PooledConnection from this ConnectionPoolDataSource. The user and password are currently ignored. If the login timeout has been set to zero, this method will block indefinately. If the timeout has been set to something other than zero, this method is guaranteed to return (or throw a SQLException) within the specified time period.
Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
See Also:
ConnectionPoolDataSource

getPooledConnection

public javax.sql.PooledConnection getPooledConnection()
                                               throws java.sql.SQLException
Get a PooledConnection from this ConnectionPoolDataSource. If the login timeout has been set to zero, this method will block indefinately. If the timeout has been set to something other than zero, this method is guaranteed to return (or throw a SQLException) within the specified time period.
Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
See Also:
ConnectionPoolDataSource

Protomatter Classes v1.1.6
Copyright 1998-2001 Nate Sammons

Protomatter Classes v1.1.6 http://protomatter.sourceforge.net/1.1.6