com.ibm.as400.access
Interface AS400JDBCStatementListener


public interface AS400JDBCStatementListener

Represents a listener that will get notified when certain events occur during the processing of an SQL statement. Note that modifySQL() is called before commentsStripped() is called. The methods on this listener are invoked when the Toolbox JDBC driver constructs an SQL statement internally, before it is executed on the server.


Method Summary
 void commentsStripped(Connection connection, String oldSQL, String newSQL)
          Notifies the listener that comments have been stripped off of the SQL statement to be executed.
 String modifySQL(Connection connection, String sql)
          Gives the listener an opportunity to modify the SQL statement before it is executed.
 

Method Detail

modifySQL

String modifySQL(Connection connection,
                 String sql)
                 throws SQLException
Gives the listener an opportunity to modify the SQL statement before it is executed.

Parameters:
connection - The connection to the server that the statement will execute under.
sql - The original SQL string.
Returns:
The SQL string this listener wants to execute instead of the original. If this listener does not want to modify the SQL string, then it should either return the sql parameter as it was passed in, or null. Returning null will cause the Toolbox JDBC driver to use the original SQL string.
Throws:
SQLException - Thrown by the listener if necessary.

commentsStripped

void commentsStripped(Connection connection,
                      String oldSQL,
                      String newSQL)
                      throws SQLException
Notifies the listener that comments have been stripped off of the SQL statement to be executed.

Parameters:
connection - The connection to the server that the statement will execute under.
oldSQL - The original SQL string.
newSQL - The SQL string with comments stripped off of it.
Throws:
SQLException - Thrown by the listener if necessary.