public class DataSourceSpy extends Object implements DataSource, Spy
You can get log4jdbc to work on this using the following config changes
| Constructor and Description |
|---|
DataSourceSpy(DataSource realDataSource)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
getClassType()
Get the type of class being spied upon.
|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
Integer |
getConnectionNumber()
Get the connection number.
|
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
boolean |
isWrapperFor(Class<?> iface) |
protected void |
reportException(String methodCall,
SQLException exception)
Report to the logger all exceptions which have to be reported by this class
|
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
<T> T |
unwrap(Class<T> iface) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParentLoggerpublic DataSourceSpy(DataSource realDataSource)
realDataSource - the real DataSourceprotected void reportException(String methodCall, SQLException exception)
methodCall - the method which threw an exceptionexception - the thrown exceptionpublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic String getClassType()
SpygetClassType in interface Spypublic Integer getConnectionNumber()
SpygetConnectionNumber in interface SpyCopyright © 2013 Bgee - Swiss Institute of Bioinformatics. All Rights Reserved.