aspose file tools*
The moose likes JDBC and the fly likes Delete a row by comparing two tables without frontend screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Delete a row by comparing two tables without frontend screen" Watch "Delete a row by comparing two tables without frontend screen" New topic
Author

Delete a row by comparing two tables without frontend screen

Uma, Mula
Greenhorn

Joined: Aug 07, 2001
Posts: 6
I am trying to compare two table data and if we happpen to delete a row in first table it has to delete in the second table also. And my program has to be bidirectional also. I mean it has to check from table 1 to 2 or 2 to 1 according to the requirement. Please tell me how to write a program for this application.
thankyou
uma
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Uma, Mula:
I am trying to compare two table data and if we happpen to delete a row in first table it has to delete in the second table also. And my program has to be bidirectional also. I mean it has to check from table 1 to 2 or 2 to 1 according to the requirement. Please tell me how to write a program for this application.
thankyou
uma

sounds like a database trigger would be more suitable here. If it is due to avoiding "orphaned" rows, you should have some sort of table relationships deal with this. Sounds like a lot of overhead to be maintaining the tables programmatically.
Also, no one is going to write the program for you(for free). Give it your best shot, then post the relevant code if you are having troubles. If you don't know where to begin, try Sun's JDBC tutorials:
http://java.sun.com/docs/books/tutorial/jdbc/index.html
Jamie
 
jQuery in Action, 2nd edition
 
subject: Delete a row by comparing two tables without frontend screen