nl.knowledgeplaza.util.jdbc
Class PreparedStatement

java.lang.Object
  extended by nl.knowledgeplaza.util.jdbc.PreparedStatement
All Implemented Interfaces:
java.lang.reflect.InvocationHandler
Direct Known Subclasses:
CallableStatement

public class PreparedStatement
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

This is for logging SQL statements to log4j. Use the wrap method in Connection to wrap a connection object and that is it.

Version:
$Revision: 1.3 $

Field Summary
static java.lang.String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
protected PreparedStatement(java.sql.PreparedStatement preparedStatement)
           
 
Method Summary
 Connection getConnection()
           
 java.lang.String getMyPrefix()
           
 java.sql.PreparedStatement getPreparedStatement()
          returns the original object for handling driver specific functions
 java.lang.String getSql()
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 void setConnection(Connection value)
           
 void setSql(java.lang.String Sql)
           
static java.sql.PreparedStatement wrapPreparedStatement(java.sql.PreparedStatement preparedStatement, java.lang.String sql, Connection connection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final java.lang.String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

PreparedStatement

protected PreparedStatement(java.sql.PreparedStatement preparedStatement)
Method Detail

getPreparedStatement

public java.sql.PreparedStatement getPreparedStatement()
returns the original object for handling driver specific functions


wrapPreparedStatement

public static java.sql.PreparedStatement wrapPreparedStatement(java.sql.PreparedStatement preparedStatement,
                                                               java.lang.String sql,
                                                               Connection connection)
Parameters:
preparedStatement -
Returns:

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

getMyPrefix

public java.lang.String getMyPrefix()

setSql

public void setSql(java.lang.String Sql)

getSql

public java.lang.String getSql()

setConnection

public void setConnection(Connection value)

getConnection

public Connection getConnection()


Copyright © 2010 KnowledgePlaza. All Rights Reserved.