• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to call a Java Object / Servlet from a Trigger

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Show errors will help work out what is wrong.
reply
    Bookmark Topic Watch Topic
  • New Topic