Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes auto insert/update/delete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "auto insert/update/delete" Watch "auto insert/update/delete" New topic
Author

auto insert/update/delete

liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
Hello,
I want to be able access in .jsp pages my parent table and do auto insert/update/delete for my newly made child table. For this, I used

ALTER TABLE child_tbl ADD FOREIGN KEY (id_in_child) REFERENCES parent_tbl (id_in_parent) ON DELETE CASCADE ON UPDATE CASCADE;

So, does it mean at this point I wont have to open a separate connection, create a separate Statement, do insert/update/delete separately for each table - ie. only parent table is referenced in a .jsp page and the same operation done on a parent table will also automaticaly be on a child table?
 
 
subject: auto insert/update/delete
 
Similar Threads
EJB 3 CascadeType annotation. What for it is required exactly.
Hibernate - ObjectDeletedException: deleted object would be re-saved by cascade...
cascade vs inverse
hibernate child set didn't deleting the objects when updating
hibernate get parent based on children