A trigger (in databases anyway) are fired when something happens in the database. For example, you can add a trigger when someone updates a record in a table - perhaps it checks to ensure that the record is less than 2 weeks old, or the trigger should make the update fail.
You set the trigger in the database - affecting the database from Java will fire the trigger (by the database). The nice thing about triggers is that they will fire regardless of how you're affecting the database (from Java, from Perl, from a command line utility, etc).
Hope that helps. If it doesn't, tell us more about what you're trying do, why you're asking, or in what context you're using the term "trigger".
Originally posted by Nakata kokuyo: hi, good day, what is trigger and how to implement it in java environment, when should we use it ? thank you
In simple terms, trigger is a implicit procedure that gets executed when an insert, update or delete is done on a table/view. A trigger can be executed before or after the insert, update or delete statement gets executed.