org.logicalcobwebs.dbscript
Interface CommandFilterIF


public interface CommandFilterIF

Allows you to perform tasks just before and just after a command is executed. You can also catch exceptions that happen.

Since:
Proxool 0.5
Version:
$Revision: 1.5 $, $Date: 2003/03/03 11:12:03 $
Author:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

Method Summary
 void afterCommand(java.sql.Connection connection, CommandIF command)
          Implement this if you want to do something special after each command is run but before the connection is closed
 boolean beforeCommand(java.sql.Connection connection, CommandIF command)
          Implement this if you want to do something special before each command is run.
 boolean catchException(CommandIF command, java.sql.SQLException e)
          Any SQLException will be passed to this method.
 

Method Detail

beforeCommand

boolean beforeCommand(java.sql.Connection connection,
                      CommandIF command)
                      throws java.sql.SQLException
Implement this if you want to do something special before each command is run.

Parameters:
connection - the connection being used
command - the command about to be run
Returns:
true if the command should be executed, or false to skip the command
Throws:
java.sql.SQLException - if anything goes wrong. This will terminate the script.

afterCommand

void afterCommand(java.sql.Connection connection,
                  CommandIF command)
                  throws java.sql.SQLException
Implement this if you want to do something special after each command is run but before the connection is closed

Parameters:
connection - the connection being used
command - the command that was run
Throws:
java.sql.SQLException - if anything goes wrong. This will terminate the script.

catchException

boolean catchException(CommandIF command,
                       java.sql.SQLException e)
Any SQLException will be passed to this method.

Parameters:
e - the exception
Returns:
true if execution should continue, false if it should stop (including any remaining executions in the loop)