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

Re: JDBC SQLCodes or Error Numbers - Or how to handle errors

From: Rene Pijlman <rene(at)lab(dot)applinet(dot)nl>
To: User One <user1(at)fictionary(dot)org>
Cc: PGSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC SQLCodes or Error Numbers - Or how to handle errors
Date: 2001-10-28 08:55:54
Message-ID: 4qhntt4bk2h3vcgvv0jrjp8r8sh4hv6u3n@4ax.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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(at)lab(dot)applinet(dot)nl>

In response to

Responses

pgsql-jdbc by date

Next:From: Rene PijlmanDate: 2001-10-28 09:07:06
Subject: Re: DatabaseMetaData.getTables()
Previous:From: User OneDate: 2001-10-28 07:33:07
Subject: JDBC SQLCodes or Error Numbers - Or how to handle errors

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