|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--safejdbc.LoggingWrapper
If you want to log your SQL-Statements you just have to wrap your ConnectionProvider with a LoggingWrapper.
Constructor Summary | |
LoggingWrapper(ConnectionProvider conprovider)
This constructor is for your convenience. |
|
LoggingWrapper(ConnectionProvider conprovider,
LogListener loglistener)
Every SQL-Statement will be handed over to the LogListener. |
Method Summary | |
java.sql.Connection |
getConnection()
This method is called to actually give the connection |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LoggingWrapper(ConnectionProvider conprovider)
this(conprovider, new LogListener() { public void log(String sqlstmt) { System.out.println(sqlstmt); } });
public LoggingWrapper(ConnectionProvider conprovider, LogListener loglistener)
LogListener loglistener = new LogListener() { public void log(String sqlstmt) { MyLogger.log(sqlstmt); } }; ConnectionProvider conprovider = new DataSourceAdapter(myDataSource); ConnectionProvider loggingconprovider = new LoggingWrapper(conprovider, loglistener); SQL sql = new SQLExecuter(loggingconprovider); // ...
Method Detail |
public java.sql.Connection getConnection() throws java.sql.SQLException
ConnectionProvider
getConnection
in interface ConnectionProvider
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |