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 javax.sql.CommonDataSource realDataSource
protected java.lang.String rdsName
protected 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.SQLException
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLoginTimeout(int inVar) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter inVar) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException
public javax.sql.PooledConnection getPooledConnection() throws java.sql.SQLException
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
java.sql.SQLException
public javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
java.sql.SQLException
public javax.sql.XAConnection getXAConnection() throws java.sql.SQLException
getXAConnection
in interface javax.sql.XADataSource
java.sql.SQLException
public javax.sql.XAConnection getXAConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
getXAConnection
in interface javax.sql.XADataSource
java.sql.SQLException
public void setJdbcEventListenerFactory(JdbcEventListenerFactory jdbcEventListenerFactory)