This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "invoking a trigger" Watch "invoking a trigger" New topic

invoking a trigger

Loh Ying Hui

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 ?

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

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.
Loh Ying Hui

Joined: Feb 03, 2002
Posts: 22
oh! I didnt notice i wrote createPreparedStatement instead of preparedstatement. anywayz, thanx for the link!
Don't get me started about those stupid light bulbs.
subject: invoking a trigger
Similar Threads
getting error while droping the user in oracle.
Can we explicitly call triggers?
What Is Trigger?
Practical usages of PrePersist() & PostPersist()
jdbc-trigger creation