|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.samples.TriggerPassData
public class TriggerPassData
This sample application shows how to pass data to a trigger.
| Field Summary |
|---|
| Fields inherited from interface org.h2.api.Trigger |
|---|
DELETE, INSERT, UPDATE |
| Constructor Summary | |
|---|---|
TriggerPassData()
|
|
| Method Summary | |
|---|---|
void |
fire(java.sql.Connection conn,
java.lang.Object[] old,
java.lang.Object[] row)
This method is called for each triggered action. |
void |
init(java.sql.Connection conn,
java.lang.String schemaName,
java.lang.String triggerName,
java.lang.String tableName,
boolean before,
int type)
This method is called by the database engine once when initializing the trigger. |
static void |
main(java.lang.String... args)
This method is called when executing this sample application from the command line. |
static void |
setTriggerData(java.lang.String trigger,
java.lang.String data)
Call this method to change a specific trigger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TriggerPassData()
| Method Detail |
|---|
public static void main(java.lang.String... args)
throws java.lang.Exception
args - the command line parameters
java.lang.Exception
public void init(java.sql.Connection conn,
java.lang.String schemaName,
java.lang.String triggerName,
java.lang.String tableName,
boolean before,
int type)
Trigger
init in interface Triggerconn - a connection to the databaseschemaName - the name of the schematriggerName - the name of the trigger used in the CREATE TRIGGER
statementtableName - the name of the tablebefore - whether the fire method is called before or after the
operation is performedtype - the operation type: INSERT, UPDATE, or DELETE
public void fire(java.sql.Connection conn,
java.lang.Object[] old,
java.lang.Object[] row)
Trigger
fire in interface Triggerconn - a connection to the databaseold - the old row, or null if no old row is available (for
INSERT)row - the new row, or null if no new row is available (for
DELETE)
public static void setTriggerData(java.lang.String trigger,
java.lang.String data)
trigger - the trigger namedata - the data
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||