com.caucho.sql.spy
Class SpyConnectionPoolDataSource

java.lang.Object
  extended by com.caucho.sql.spy.SpyConnectionPoolDataSource
All Implemented Interfaces:
javax.sql.CommonDataSource, javax.sql.ConnectionPoolDataSource

public class SpyConnectionPoolDataSource
extends java.lang.Object
implements javax.sql.ConnectionPoolDataSource

Spying on a driver.


Field Summary
protected static L10N L
           
protected static java.util.logging.Logger log
           
 
Constructor Summary
SpyConnectionPoolDataSource(javax.sql.ConnectionPoolDataSource dataSource, java.lang.String id)
          Creates a new SpyDriver.
 
Method Summary
 int getLoginTimeout()
          Returns the login timeout.
 java.io.PrintWriter getLogWriter()
          Returns the log writer
 javax.sql.PooledConnection getPooledConnection()
          Returns the pooled connection.
 javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password)
          Returns the XAConnection.
protected  void log(long start, java.lang.String msg)
           
 void setLoginTimeout(int timeout)
          Sets the login timeout.
 void setLogWriter(java.io.PrintWriter log)
          Sets the log writer.
protected  long start()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log

L

protected static final L10N L
Constructor Detail

SpyConnectionPoolDataSource

public SpyConnectionPoolDataSource(javax.sql.ConnectionPoolDataSource dataSource,
                                   java.lang.String id)
Creates a new SpyDriver.

Method Detail

getPooledConnection

public javax.sql.PooledConnection getPooledConnection()
                                               throws java.sql.SQLException
Returns the pooled connection.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

getPooledConnection

public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
Returns the XAConnection.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Returns the login timeout.

Specified by:
getLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

setLoginTimeout

public void setLoginTimeout(int timeout)
                     throws java.sql.SQLException
Sets the login timeout.

Specified by:
setLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Returns the log writer

Specified by:
getLogWriter in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

setLogWriter

public void setLogWriter(java.io.PrintWriter log)
                  throws java.sql.SQLException
Sets the log writer.

Specified by:
setLogWriter in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

start

protected long start()

log

protected void log(long start,
                   java.lang.String msg)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object