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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "invoking a trigger" Watch "invoking a trigger" New topic
Author

invoking a trigger

Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
can anyone tell me how can i invoke a trigger in a Database from a servlet ? what kind of statement do i need to execute ?
thanks


Regards,<br />Ying Hui
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
Typically triggers are set to be invoked when someone inserts, updates, or deletes a row in the database. I don't think that triggers can be executed directly. If you need to do some sort of direct execution, use a stored procedure. Or execute the appropriate SQL from your code.
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
oh i see. can you tell me what's the difference between createStatement and createPreparedStatement ?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

createPreparedStatement --> no such method...which leads me to believe you may need to have a read through Sun's
JDBC tutorial for the basic's.
Jamie
Loh Ying Hui
Greenhorn

Joined: Feb 03, 2002
Posts: 22
oh! I didnt notice i wrote createPreparedStatement instead of preparedstatement. anywayz, thanx for the link!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invoking a trigger