Open GoogleCodeExporter opened 8 years ago
I guess we can do something like
public class Log4jdbcProxyDataSource implements DataSource {
@Override
public Connection getConnection() throws SQLException
{
if (getLogFormatter().isJdbcLoggingEnabled()) {
final Connection connection = realDataSource.getConnection();
return new ConnectionSpy(connection,DriverSpy.getRdbmsSpecifics(connection));
}
else {
return realDataSource.getConnection();
}
}
}
do you see any problem with that?
Original comment by dsoma...@gmail.com
on 1 Mar 2013 at 7:16
once I changed the following methods FROM
@Override
public Connection getConnection() throws SQLException
{
final Connection connection = realDataSource.getConnection();
return new ConnectionSpy(connection,DriverSpy.getRdbmsSpecifics(connection));
}
@Override
public Connection getConnection(String username, String password) throws SQLException
{
final Connection connection = realDataSource.getConnection(username, password);
return new ConnectionSpy(connection,DriverSpy.getRdbmsSpecifics(connection));
}
TO
@Override
public Connection getConnection() throws SQLException
{
final Connection connection = realDataSource.getConnection();
if (getLogFormatter().isJdbcLoggingEnabled()) {
return new ConnectionSpy(connection,DriverSpy.getRdbmsSpecifics(connection));
}
else {
return connection;
}
}
@Override
public Connection getConnection(String username, String password) throws SQLException
{
final Connection connection = realDataSource.getConnection(username, password);
if (getLogFormatter().isJdbcLoggingEnabled()) {
return new ConnectionSpy(connection,DriverSpy.getRdbmsSpecifics(connection));
}
else {
return connection;
}
}
I don't see log4jdbc in play when logging is turned off and profiler looks
good. Could you please incorporate this change?
Original comment by dsoma...@gmail.com
on 4 Mar 2013 at 6:41
Original issue reported on code.google.com by
dsoma...@gmail.com
on 1 Mar 2013 at 7:01