Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create trigger using java code

 
Rakhi K
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to create oracle trigger using java code?
[ October 08, 2002: Message edited by: Rakhi K ]
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Triggers are implicitly executed by the database when an event occurs. The event for e.g. could be ON DELETE,INSERT, UPDATE of a table row or it could be ON STARTUP of database.

If u want to execute perform the event and as a result the trigger for the corresponding even gets exceuted.
U cannot call triggers explicitly.
 
Michael Matola
whippersnapper
Ranch Hand
Posts: 1826
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rakhi,
Please adjust your displayed name to meet the JavaRanch Naming Policy. You can do so here.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To create use Statements
 
John Carnell
Author
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rakhi:
How to create oracle trigger using java code?
[ October 08, 2002: Message edited by: Rakhi K ]

Hi Rakhi,
I think what you want to do is write a Java-based stored procedure. Then you will have to write a PL/SQL based Oracle trigger to call the Java-stored procedure you wrote. You can not write Java-based triggers directly. They always have to be written in PL/SQL.
Two books from Wrox have examples of how to write Java-based stored procedures. These books are:
Oracle 8i Application Programming
Oracle 9i Java
As a disclosure: I wrote some chapters for these books, so I do have some bias in promoting them.
I hope that helps.
Thanks,
John
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic