arthurblake / log4jdbc

log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing information) for other JDBC drivers using the Simple Logging Facade For Java (SLF4J) logging system.
516 stars 147 forks source link

ResultSetSpy.getStatement returns the real statement, not a statement spy #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a ResultSetSpy by running a query of some kind
2. Call getStatement on the ResultSet

What is the expected output? What do you see instead?
I expect getStatement to return a StatementSpy, but I see a StatementImpl 
instead

What version of the product are you using? On what operating system?
1.2

Please provide any additional information below.
FWIW, StatementSpy.getConneciton returns the ConnectionSpy

Original issue reported on code.google.com by ryan.for...@gmail.com on 27 Sep 2012 at 8:10

GoogleCodeExporter commented 9 years ago
diff log4jdbc-1.2/src-jdbc4/net/sf/log4jdbc/ResultSetSpy.java ResultSetSpy.java 
1985,1993c1985
<     try
<     {
<       return (Statement) reportReturn(methodCall, 
realResultSet.getStatement());
<     }
<     catch (SQLException s)
<     {
<       reportException(methodCall, s);
<       throw s;
<     }
---
>     return (Statement) reportReturn(methodCall, parent);// 
realResultSet.getStatement());
2945c2937
< }
\ No newline at end of file
---
> }

Original comment by ryan.for...@gmail.com on 27 Sep 2012 at 9:11

GoogleCodeExporter commented 9 years ago
Good catch. Fixed, rev 106.

Original comment by arthur.b...@gmail.com on 27 Sep 2012 at 9:40