aspose file tools*
The moose likes JDBC and the fly likes how to find child table names that need to be deleted? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to find child table names that need to be deleted?" Watch "how to find child table names that need to be deleted?" New topic
Author

how to find child table names that need to be deleted?

pete johnson
Greenhorn

Joined: Mar 24, 2005
Posts: 19
hello,

i have a master table and there are a few child tables. i need to
delete a record in the master table, but i dont want to delete
dependent child records by cascading. i want the program to catch
JDBC exception and then to display an alert
of asking users to delete child records manually. i dont want "soft delete"
(using a true/false flag).

to better inform users about where child records reside,
i want the table names to be displayed in the alert. is any
general way for extracting child table names from JDBC exceptions?

thanks for your advice and information!

pete
Annie Smith
Ranch Hand

Joined: Mar 05, 2005
Posts: 172
I'm not sure of this, but I guess this should help you with your problem.

[ October 10, 2005: Message edited by: Annie Smith ]

Cheers!<br /><b>Annie</b>
pete johnson
Greenhorn

Joined: Mar 24, 2005
Posts: 19
i am using JTDS driver. after looking at the nested exceptions due to deleting master records that have child records, i found that the nested
exceptions actually do have the names of the tables that have child records. i can extract such information. not quite sure it is true of
other JDBC drivers.

thanks for your input!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to find child table names that need to be deleted?