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