Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JDBC Listener

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want your help.
I will explain my problem.
Suppose a user insert one row in the database.(Any operation such as update,delete etc)
I want to get one trigger from the database such that this row is updated ,deleted or inserted in the database through JDBC.
Is it possible?
Please help me.
With regards
Dhaneep Raghavan
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can you please explain what do u really want to do? What i understand is , when the user insert one record, using JDBC, one trigger should get fired. But can you tell me, what do u want to do after the trigger gets fired. So that I hope, I can give you the answer.
Chandan D.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi dhaneep........
why u want to use triggers.......? if the same thing u can achiev thro' java.
while executing any update statement u must b using executeUpdate() of Statement which returns u number of rows updated and u know what kind of query it is (insert /update / delete). so u can use prinln statement after getting the number of rows updated from executeUpdate().......hope this helps.....Ajit

 
Dhaneep Raghavan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chand,
Thanks for your replay.
I will explain it clearly.
What you said is correct.When insert one record
,using jdbc ,one trigger shold be fired.Absolutely correct.
But problem here is , we doesn't know who or which application update/insert/create the record.We have the full database access.
That's all.If some one update this database at the same time I wants to know which record, which field is updated.
I am expecting your precious replay.
Please help me.

Originally posted by chand desh:
Hi,
Can you please explain what do u really want to do? What i understand is , when the user insert one record, using JDBC, one trigger should get fired. But can you tell me, what do u want to do after the trigger gets fired. So that I hope, I can give you the answer.
Chandan D.


 
Dhaneep Raghavan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ajith,
Thanks for your replay.
Ajith my problem is ,
If we are executing some SQL statement then we can
use executeUpdate().But in this scenario we doesn't know
who is update/insert/delete the row in the table.
I wants to know one particular field(s) are updated or one particular row inserted or deleted.
I am expecting your replay.
Please help me.
With regards
Dhaneep raghvan
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
what i get is that you need a change tracking in the database, i.e. when and who made the changes. well if you are using oracle you can enable the audit ttrailing at the database level or you can design few tables and a set of triggers which can capture this information for you.
If you need more help let me know...
HTH!
Arun
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Can anyone explain this solution in clear?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe what he wants (and what I would like) is a database independent way to be notified when the database changes. A database may be changed by many applications not just my Java code and I would like to be notified of these events

For example, application A inserts a row in a table. In my code I would like to know that. So I can either receive change events or resort to polling.

 
knowledge is the difference between drudgery and strategic action -- tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic