• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need to call a Java Object / Servlet from a Trigger

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi could anyone please help me on this issue .

We are using Oracle 10g as our DataBase .

Is it possile to write a Trigger in such a way that whenever there is a chnage in Database (insert/update) We need to call a Servlet/Or any Java Program

Any link will be a great help .

Thanks in advance .
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle does let you Java-based stored procedures into the system, but its been awhile since I've done it.
 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you find java stored trigger sample:
http://www.oracle.com/technology/sample_code/tech/java/jsp/oracle9ijsp.html

I am not sure if calling servlet from the triger at each insert/update is a good idea, that could cause performance problems.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Thanks for the replies when i tried with this syntax :


// I had created a servlet and placed it in my server .

At first

When i created this trigger in Oracle it displayed as
Warning: Trigger created with compilation errors.

and when i inserted some sample values in the dept table in database .

ORA-04098: trigger 'SCOTT.LAD' is invalid and failed re-validation


Any ideas .
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show errors will help work out what is wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic