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() |
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParentLogger
isWrapperFor, unwrap
public 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 DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public String getClassType()
Spy
getClassType
in interface Spy
public Integer getConnectionNumber()
Spy
getConnectionNumber
in interface Spy
Copyright © 2013 Bgee - Swiss Institute of Bioinformatics. All Rights Reserved.