View Single Post

   
  #2 (permalink)  
Old 04-09-2008, 10:20 AM
Kris Jurka
 
Posts: n/a
Default Re: catch SQLException, error code for Foeign key violation,



On Mon, 17 Apr 2006, surabhi.ahuja wrote:

> The question is that is from this SQLException can i detect if it is a
> foreign key violation,
>


You should check the value of SQLException.getSQLState() against this
table:
http://www.postgresql.org/docs/8.1/s...-appendix.html

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote