Re: JDBC SQLCodes or Error Numbers - Or how to handle errors - Mailing list pgsql-jdbc

From Henry D.
Subject Re: JDBC SQLCodes or Error Numbers - Or how to handle errors
Date
Msg-id 3BDC6718.3FCA136A@fictionary.org
Whole thread Raw
In response to JDBC SQLCodes or Error Numbers - Or how to handle errors  (User One <user1@fictionary.org>)
List pgsql-jdbc
Is there a "better" way to test for duplicate rows than by first do a
select to see if the key already exists?
Henry D.

Rene Pijlman wrote:

> On Sun, 28 Oct 2001 00:33:07 -0700, you wrote:
> >I'm used to just doing the insert and catching the SQLCODE -803
> >on DB2 to know that the row I'm trying to insert already exists.
> >
> >Is there an easy way to do this using Postgresql and JDBC?
>
> I'm afraid not.
>
> "SQLException.getErrorCode() always returns 0. The PostgreSQL
> backend currently doesn't provide error codes. This issue is on
> the TODO list (Admin: 'Allow elog() to return error codes').
> Once it is fixed in the backend and the FE/BE protocol, it can
> be fixed in the JDBC driver as well."
> http://lab.applinet.nl/postgresql-jdbc/#SQLException
>
> Regards,
> René Pijlman <rene@lab.applinet.nl>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


pgsql-jdbc by date:

Previous
From: "Dave Cramer"
Date:
Subject: Re: DatabaseMetaData.getTables()
Next
From: Rene Pijlman
Date:
Subject: Re: jdbc capabilities