wood burning stoves 2.0*
The moose likes JDBC and the fly likes JDBC Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Listener" Watch "JDBC Listener" New topic
Author

JDBC Listener

Dhaneep Raghavan
Greenhorn

Joined: Aug 13, 2001
Posts: 4
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

Dhaneep
chand desh
Greenhorn

Joined: Aug 13, 2001
Posts: 2
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.
Ajit B
Greenhorn

Joined: Jul 24, 2001
Posts: 28
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

Joined: Aug 13, 2001
Posts: 4
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

Joined: Aug 13, 2001
Posts: 4
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
getarun
Greenhorn

Joined: Aug 16, 2001
Posts: 1
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
raghu ulli
Greenhorn

Joined: Jul 24, 2009
Posts: 1
Hi,Can anyone explain this solution in clear?
donncha mooney
Greenhorn

Joined: Aug 25, 2009
Posts: 1
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.

 
Don't get me started about those stupid light bulbs.
 
subject: JDBC Listener
 
Similar Threads
BMP Query???
accessing a row
SQL Database Structure
Javascript or vbscript and ASP
accessing buffer to transfer data