X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A109352977 for ; Thu, 28 Jul 2005 12:13:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76222-09 for ; Thu, 28 Jul 2005 15:13:47 +0000 (GMT) Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.91]) by svr1.postgresql.org (Postfix) with ESMTP id 9B1DA52930 for ; Thu, 28 Jul 2005 12:13:45 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Thu, 28 Jul 2005 10:13:39 -0500 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Date: Thu, 28 Jul 2005 10:13:21 -0500 From: "Kevin Grittner" To: , Cc: Subject: Re: SQLException and error code Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/400 X-Sequence-Number: 13548 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 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