can anybody tell how to implement a trigger in a jdbc program?

Recommended Answers

All 3 Replies

Triggers have got nothing to do with JDBC, they are database specific. A trigger is executed when a condition predetermined in the trigger is encountered. Triggers are written on tables to act before or after the action specified.

Triggers remain transparent to the Java programmer AFAIK, though you can call stored procedures which on changing the state of the database can trigger the execution of tirggers.

using callablestaments we can execute the trigger?

No, you can only call stored procedures. Like I previously mentioned, you don't explicitly call triggers, neither using Java nor using SQL, thats exactly the whole point behind triggers, they are like callback statements, which are executed automatically when a event occurs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.