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

Error codes in JDBC drivers

From: Sheer El-Showk <sheer(at)saraf(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Error codes in JDBC drivers
Date: 2001-04-06 19:24:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
I'm using what I presume to be the only/most popular JDBC for postgres
(from; the actual jar is
jdbc7.0-1.1.jar -- please let me know if there are any others) but am a
little concerned that its error reporting (via java SQL exceptions) seems
to use only strings rather then setting the exceptions error code (vendor
specific or XOPEN standard).

I need to be able to catch SQLExceptions and convert them to my own,
application specific exceptions ... I can even do this by parsing a string
(though I would rather an error code), but I don't know how to reliably
extract DB errors from the exceptions thrown by the postgres JDBC driver.

Any suggestions, references or help would be greatly appreciate.


pgsql-jdbc by date

Next:From: Homayoun Yousefi'zadehDate: 2001-04-09 22:33:19
Subject: JDBC and Perl compiling problems w/ postgresql-7.1rc4
Previous:From: chris markiewiczDate: 2001-04-06 14:59:37
Subject: RE: null to zero?

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