CONSTRAINT Violations
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tuan_Truong
Posted On:   Tuesday, October 23, 2001 02:12 PM

Hi

What exception will be thrown when inserting/updating/deleting a row that causes constraint viloation? Thanks.

Re: CONSTRAINT Violations

Posted By:   Bozidar_Dangubic  
Posted On:   Wednesday, October 24, 2001 04:21 AM

SQLException. It is just about always thrown when database problems occur. getErrorCode() will give you vendor-specific error code which then you can cross-reference in the manual for the exact problem. in some cases, drivers are so nice with constraint violations that they will give you the exact violation in the message of the exception (getMessage() return) but most of the time you will have to consult the manual and use db software to get the exact cause (that is if there are many constraint violations that can occur on a execution of a single statement).
About | Sitemap | Contact