Skip site navigation (1) Skip section navigation (2)

Re: Foreign key constraint & getErrorCode

From: Ian Pilcher <i(dot)pilcher(at)comcast(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Foreign key constraint & getErrorCode
Date: 2004-09-11 02:33:41
Message-ID: chto65$pf2$ (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Oliver Jowett wrote:
> Try SQLException.getSQLState() instead. The backend returns (somewhat 
> standardized) alphanumeric SQL states with errors and the driver exposes 
> these as via getSQLState(). getErrorCode() is numeric, vendor-specific, 
> and unused by the current driver.

Works like a charm.  Thanks!

(I didn't realize that the PostgreSQL error codes were alphanumeric;
makes it kind of hard to pack into an integer.)

Ian Pilcher                                        i(dot)pilcher(at)comcast(dot)net

In response to

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2004-09-11 07:19:34
Subject: Re: JDBC driver for Postgresql 7.5-devel version
Previous:From: Oliver JowettDate: 2004-09-10 22:43:46
Subject: Re: Foreign key constraint & getErrorCode

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group