Package org.soulwing.jdbc.logger
Class PrintWriterJdbcLogger
- java.lang.Object
-
- org.soulwing.jdbc.logger.PrintWriterJdbcLogger
-
- All Implemented Interfaces:
JdbcLogger
public class PrintWriterJdbcLogger extends Object implements JdbcLogger
AJdbcLogger
that delegates to a print stream or print writer.- Author:
- Carl Harris
-
-
Constructor Summary
Constructors Constructor Description PrintWriterJdbcLogger(PrintStream delegate)
Constructs a new instance.PrintWriterJdbcLogger(PrintStream delegate, boolean traceEnabled)
Constructs a new instance.PrintWriterJdbcLogger(PrintWriter delegate)
Constructs a new instance.PrintWriterJdbcLogger(PrintWriter delegate, boolean traceEnabled)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
writeParameters(Parameter[] parameters)
Writes the parameters that will be bound for an SQL statement.void
writeStatement(String sql)
Writes the text of an SQL statement to the log.
-
-
-
Constructor Detail
-
PrintWriterJdbcLogger
public PrintWriterJdbcLogger(PrintWriter delegate)
Constructs a new instance.- Parameters:
delegate
- delegate print writer
-
PrintWriterJdbcLogger
public PrintWriterJdbcLogger(PrintStream delegate)
Constructs a new instance.- Parameters:
delegate
- delegate print stream
-
PrintWriterJdbcLogger
public PrintWriterJdbcLogger(PrintWriter delegate, boolean traceEnabled)
Constructs a new instance.- Parameters:
delegate
- delegate print writertraceEnabled
- flag indicating whether trace level logging should be used
-
PrintWriterJdbcLogger
public PrintWriterJdbcLogger(PrintStream delegate, boolean traceEnabled)
Constructs a new instance.- Parameters:
delegate
- delegate print streamtraceEnabled
- flag indicating whether trace level logging should be used
-
-
Method Detail
-
writeStatement
public void writeStatement(String sql)
Description copied from interface:JdbcLogger
Writes the text of an SQL statement to the log.- Specified by:
writeStatement
in interfaceJdbcLogger
- Parameters:
sql
- the SQL statement text to write
-
writeParameters
public void writeParameters(Parameter[] parameters)
Description copied from interface:JdbcLogger
Writes the parameters that will be bound for an SQL statement.This method is invoked immediately after
JdbcLogger.writeStatement(String)
to log the actual parameter values that will be used to replace statement placeholders.An implementation should check the configuration of the underlying log system as to whether this level of detail is enabled.
- Specified by:
writeParameters
in interfaceJdbcLogger
- Parameters:
parameters
- values that will be bound before statement execution
-
-