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

      Methods 
      Modifier and Type Method and Description
      void commentsStripped(java.sql.Connection connection, java.lang.String oldSQL, java.lang.String newSQL)
      Notifies the listener that comments have been stripped off of the SQL statement to be executed.
      java.lang.String modifySQL(java.sql.Connection connection, java.lang.String sql)
      Gives the listener an opportunity to modify the SQL statement before it is executed.
    • Method Detail

      • modifySQL

        java.lang.String modifySQL(java.sql.Connection connection,
                                 java.lang.String sql)
                                   throws java.sql.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:
        java.sql.SQLException - Thrown by the listener if necessary.
      • commentsStripped

        void commentsStripped(java.sql.Connection connection,
                            java.lang.String oldSQL,
                            java.lang.String newSQL)
                              throws java.sql.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:
        java.sql.SQLException - Thrown by the listener if necessary.