wood burning stoves 2.0*
The moose likes JDBC and the fly likes what is trigger ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "what is trigger ?" Watch "what is trigger ?" New topic
Author

what is trigger ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
hi, good day, what is trigger and how to implement it in java environment, when should we use it ? thank you
todd runstein
Ranch Hand

Joined: Feb 15, 2005
Posts: 64
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".
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
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.
 
 
subject: what is trigger ?
 
Similar Threads
Issue in Inserting / Updating the table with trigger using Hibernate
JPanel and JFrame listener
How to start a Trigger from a java Application
When to do the dishes?
mutating trigger