error codes using JDBC

Lists: pgsql-jdbc
From: "Krishnakanth Rao" <raokr(at)india(dot)hp(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: error codes using JDBC
Date: 2004-07-15 08:59:00
Message-ID: 001201c46a49$f94804e0$e72a0a0f@india.hp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi,

I'am using the jdbc driver pg73jdbc3.jar in my jdbc code to acces PostGRE
SQL. Whenever a sql exception occurs it doesnt give me the appropriate error
code , eg referential integrity constraint voilated etc. The error code from
the SQLException is always zero.

How do I obtain the exact error code as mentioned in PostGRE documents

Regards
K Krishnakanth Rao
Senior Software Engineer
HP Global Delivery India Center

29 Cunningham Road
Bangalore - 560 052 India

+91 80 22051374 DID
+91 98456 82188 Mobile

Disclaimer:
This e-mail, and any files transmitted with it are "HP Confidential" and
intended solely for the use of the individual or entity to whom it is
addressed. If you have received this e-mail in error, please discard the
message and notify me directly.


From: Kris Jurka <books(at)ejurka(dot)com>
To: Krishnakanth Rao <raokr(at)india(dot)hp(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: error codes using JDBC
Date: 2004-07-15 09:12:46
Message-ID: Pine.BSO.4.56.0407150412010.32025@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Thu, 15 Jul 2004, Krishnakanth Rao wrote:

> I'am using the jdbc driver pg73jdbc3.jar in my jdbc code to acces PostGRE
> SQL. Whenever a sql exception occurs it doesnt give me the appropriate error
> code , eg referential integrity constraint voilated etc. The error code from
> the SQLException is always zero.

Error codes are a new feature and are only available when using a 7.4 or
newer server and jdbc driver.

Kris Jurka


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: raokr(at)india(dot)hp(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: error codes using JDBC
Date: 2004-07-15 09:14:59
Message-ID: 40F64B13.2070606@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Krishnakanth Rao wrote:
> Hi,
>
> I'am using the jdbc driver pg73jdbc3.jar in my jdbc code to acces PostGRE
> SQL. Whenever a sql exception occurs it doesnt give me the appropriate error
> code , eg referential integrity constraint voilated etc. The error code from
> the SQLException is always zero.
>
> How do I obtain the exact error code as mentioned in PostGRE documents

Use a 7.4 or later driver (get a recent driver from jdbc.postgresql.org)
against a 7.4 or later server; you should then get a useful SQLState in
most cases.

-O