Обсуждение: Re: Where's SQL error code???

Поиск
Список
Период
Сортировка

Re: Where's SQL error code???

От
Ken McArthur
Дата:
On Saturday 31 May 2003 04:57 pm, Ken McArthur wrote:
Switching to postgres from mysql.  mysql jdbc driver
returns the sql error code to SQLWarning.getErrorCode()
(i.e. insert with duplicate entry throws adn SQLException
with getErrorCode() = 1062).

Does anyone know where to get error codes in postgres (using
jdbc driver: pg73jdbc2ee.jar)?  I know table is set up
correctly because when I try to insert duplicate entry I
get "ERROR:  Cannot insert a duplicate key into unique
index ...".  An SQLException is thrown but getErrorCode()
is 0.

Thanks, any suggestion is much appreciated,
Ken


Re: Where's SQL error code???

От
Andrew Sullivan
Дата:
On Sat, May 31, 2003 at 09:20:14PM -0600, Ken McArthur wrote:
> Does anyone know where to get error codes in postgres (using
> jdbc driver: pg73jdbc2ee.jar)?

I'm afraid they're in development (right now, in fact, if my reading
of -hackers is correct).  You have to parse the message, I'm afraid.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110