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?
I'm not sure of this, but I guess this should help you with your problem.
[ October 10, 2005: Message edited by: Annie Smith ]
Joined: Mar 24, 2005
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.