public class P6DataSource
extends java.lang.Object
implements javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, javax.sql.XADataSource, javax.naming.Referenceable, java.io.Serializable
DataSource implementation.| Modifier and Type | Field and Description |
|---|---|
protected JdbcEventListenerFactory |
jdbcEventListenerFactory |
protected java.lang.String |
rdsName |
protected javax.sql.CommonDataSource |
realDataSource |
| Constructor and Description |
|---|
P6DataSource()
Default no-arg constructor for Serialization
|
P6DataSource(javax.sql.DataSource delegate)
Create a P6Spy DataSource wrapping another DataSource.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindDataSource()
Binds the JNDI DataSource to proxy.
|
java.sql.Connection |
getConnection() |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password) |
int |
getLoginTimeout() |
java.io.PrintWriter |
getLogWriter() |
java.util.logging.Logger |
getParentLogger() |
javax.sql.PooledConnection |
getPooledConnection() |
javax.sql.PooledConnection |
getPooledConnection(java.lang.String user,
java.lang.String password) |
java.lang.String |
getRealDataSource()
Returns the JNDI name of the real data source.
|
javax.naming.Reference |
getReference() |
javax.sql.XAConnection |
getXAConnection() |
javax.sql.XAConnection |
getXAConnection(java.lang.String user,
java.lang.String password) |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
setJdbcEventListenerFactory(JdbcEventListenerFactory jdbcEventListenerFactory) |
void |
setLoginTimeout(int inVar) |
void |
setLogWriter(java.io.PrintWriter inVar) |
void |
setRealDataSource(java.lang.String jndiName)
Sets the JNDI name of the DataSource to proxy.
|
<T> T |
unwrap(java.lang.Class<T> iface) |
protected transient javax.sql.CommonDataSource realDataSource
protected java.lang.String rdsName
protected transient JdbcEventListenerFactory jdbcEventListenerFactory
public P6DataSource()
public P6DataSource(javax.sql.DataSource delegate)
delegate - the DataSource to wrappublic java.lang.String getRealDataSource()
public void setRealDataSource(java.lang.String jndiName)
jndiName - protected void bindDataSource()
throws java.sql.SQLException
java.sql.SQLExceptionpublic javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingExceptionpublic int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLoginTimeout(int inVar)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLogWriter(java.io.PrintWriter inVar)
throws java.sql.SQLException
setLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionpublic javax.sql.PooledConnection getPooledConnection()
throws java.sql.SQLException
getPooledConnection in interface javax.sql.ConnectionPoolDataSourcejava.sql.SQLExceptionpublic javax.sql.PooledConnection getPooledConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
getPooledConnection in interface javax.sql.ConnectionPoolDataSourcejava.sql.SQLExceptionpublic javax.sql.XAConnection getXAConnection()
throws java.sql.SQLException
getXAConnection in interface javax.sql.XADataSourcejava.sql.SQLExceptionpublic javax.sql.XAConnection getXAConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
getXAConnection in interface javax.sql.XADataSourcejava.sql.SQLExceptionpublic void setJdbcEventListenerFactory(JdbcEventListenerFactory jdbcEventListenerFactory)