• 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

calling trigger from java program

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guyz ,
is there any way by which a trigger can interact with JDBC ?
I want to check the database each time its updated and if some condition is violated , the info((row from table which has voilated some rule) is passed to java code which can then take necessary action . Can anyone help me out in this because i am not aware of any way by which a trigger can interact with java code .
Regards,
Nikhi
 
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nikhi,

Welcome to JavaRanch.

is there any way by which a trigger can interact with JDBC ?


Generally, we don't trigger the triggers(database) directly.They get called automatically by database when some operations like insert,update,delete occurs. More about trigger

I want to check the database each time its updated and if some condition is violated

There are many ways you can validate the data.

1)You can put constraints in database itself
2)You can validate the user/file input in your java code too.

Does it help you?
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more thing,

You should adhere JavaRanch Naming policy.(I couldn't find the link)
[ August 07, 2008: Message edited by: Vishal Pandya ]
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naming policy
 
nikhil jai
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii Vishal , thanks for your reply .But i think you didn't get my point ,actually my title is misleading .
I don't want to call trigger from anywhere .They will keep operating on the database . But what i want is as soon as some condition is violated (ie when the updated value of one of the column exceeds the limit) , i need to call the java program and need to pass that particular row to java .My java program will then take the control and take some necessary actions .
Can you help me out in this ??
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"niks",

please don't ignore Rob's post about the naming policy. Accounts without a proper screen name are generally closed.
 
Get me the mayor's office! I need to tell her about this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic