From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Peter.Zoche@materna.de
To: oliver@opencloud.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: SQLException and error code
Date: Thu, 28 Jul 2005 10:13:21 -0500
Message-ID: <s2e8afd3.056@gwmta.wicourts.gov> (raw)
To better support existing applications which (for reasons I don't
really understand) rely on the vendor-specific errorCode instead of the
ANSI-standard sqlState, you could implement getErrorCode as:
return Integer.parseInt(getSqlState(), 36);
-Kevin
>>> Oliver Jowett <oliver@opencloud.com> 07/26/05 6:33 PM >>>
Peter.Zoche@materna.de wrote:
> Because in the postgresql documentation you can find the following
page:
>
>
http://www.postgresql.org/docs/8.0/interactive/errcodes-appendix.html#ERRCOD> ES-TABLE
>
> There you can see all ERROR CODES!
Those codes are actually SQLSTATEs.
> So why is there a method getErrorCode(),
It's defined by the JDBC spec, we don't have any choice about whether it
is there or not.
> if the only thing it does
> is to return zero?
Back to my original question: what are you expecting it to return? It
can't return a SQLSTATE because it returns an int and SQLSTATE is
alphanumeric. We don't have any other useful error code. So we just
return 0 because we have to return *something*.
-O
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, Peter.Zoche@materna.de, oliver@opencloud.com
Subject: Re: SQLException and error code
In-Reply-To: <s2e8afd3.056@gwmta.wicourts.gov>
References: <s2e8afd3.056@gwmta.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox