| org.h2.api.Trigger
All known Subclasses: org.h2.test.db.TestRunscript, org.h2.fulltext.FullTextLucene, org.h2.fulltext.FullText, org.h2.test.db.TestTriggersConstraints,
Trigger | public interface Trigger (Code) | | A class that implements this interface can be used as a trigger.
|
Field Summary | |
int | DELETE The trigger is called for DELETE statements. | int | INSERT The trigger is called for INSERT statements. | int | UPDATE The trigger is called for UPDATE statements. |
Method Summary | |
void | fire(Connection conn, Object[] oldRow, Object[] newRow) This method is called for each triggered action. | void | init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) This method is called by the database engine once when initializing the
trigger. |
DELETE | int DELETE(Code) | | The trigger is called for DELETE statements.
|
INSERT | int INSERT(Code) | | The trigger is called for INSERT statements.
|
UPDATE | int UPDATE(Code) | | The trigger is called for UPDATE statements.
|
fire | void fire(Connection conn, Object[] oldRow, Object[] newRow) throws SQLException(Code) | | This method is called for each triggered action.
Parameters: conn - a connection to the database Parameters: oldRow - the old row, or null if no old row is available (for INSERT) Parameters: newRow - the new row, or null if no new row is available (for DELETE) throws: SQLException - if the operation must be undone |
init | void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) throws SQLException(Code) | | This method is called by the database engine once when initializing the
trigger.
Parameters: conn - a connection to the database Parameters: schemaName - the name of the schema Parameters: triggerName - the name of the trigger used in the CREATE TRIGGER statement Parameters: tableName - the name of the table Parameters: before - whether the fire method is called before or after theoperation is performed Parameters: type - the operation type: INSERT, UPDATE, or DELETE |
|
|