Package com.mckoi.database
Class ConnectionTriggerManager
java.lang.Object
com.mckoi.database.ConnectionTriggerManager
A trigger manager on a DatabaseConnection that maintains a list of all
triggers set in the database, and the types of triggers they are. This
object is closely tied to a DatabaseConnection.
The trigger manager actually uses a trigger itself to maintain a list of tables that have triggers, and the action to perform on the trigger.
- Author:
- Tobias Downer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createTableTrigger
(String schema, String name, int type, TableName on_table, String procedure_name, TObject[] params) Creates a new trigger action on a stored procedure and makes the change to the transaction of this DatabaseConnection.void
dropTrigger
(String schema, String name) Drops a trigger that has previously been defined.boolean
triggerExists
(String schema, String name) Returns true if the trigger exists, false otherwise.
-
Method Details
-
createTableTrigger
public void createTableTrigger(String schema, String name, int type, TableName on_table, String procedure_name, TObject[] params) throws DatabaseException Creates a new trigger action on a stored procedure and makes the change to the transaction of this DatabaseConnection. If the connection is committed then the trigger is made a perminant change to the database.- Parameters:
schema
- the schema name of the trigger.name
- the name of the trigger.type
- the type of trigger.procedure_name
- the name of the procedure to execute.params
- any constant parameters for the triggering procedure.- Throws:
DatabaseException
-
dropTrigger
Drops a trigger that has previously been defined.- Throws:
DatabaseException
-
triggerExists
Returns true if the trigger exists, false otherwise.
-