Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Delete a row by comparing two tables without frontend screen

 
Uma, Mula
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic