Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 76DA2633DFD for ; Wed, 3 Jun 2009 17:19:09 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 12749-10 for ; Wed, 3 Jun 2009 17:19:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 36F54632300 for ; Wed, 3 Jun 2009 17:19:08 -0300 (ADT) Received: by leary.csoft.net (Postfix, from userid 1112) id F0745A1C5; Wed, 3 Jun 2009 16:19:05 -0400 (EDT) Date: Wed, 3 Jun 2009 16:19:05 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Thomas Finneid cc: pgsql-jdbc@postgresql.org Subject: Re: jdbc excpetions in pg In-Reply-To: <2855.89.8.146.200.1244042913.squirrel@fcon.no> Message-ID: References: <2855.89.8.146.200.1244042913.squirrel@fcon.no> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL=0.006 X-Spam-Level: X-Archive-Number: 200906/17 X-Sequence-Number: 19681 On Wed, 3 Jun 2009, Thomas Finneid wrote: > I was looking at the documentation for the pg jdbc driver and it seems to > me that the driver throws SQLExceptions only, or mostly. I.e. the driver > does not create any subclasses of the SQLException class. Is this correct? Yes. The JDBC4 spec has created subclasses of SQLException to indicate different failure modes, but the pg driver has not implemented that yet. > If so, what is the suggested method for classifying the errors to more > detail than SQLException? I was hoping to make my code more robust by > dealing with the errors more appropriately. You should check the SQLState of the SQLException to determine the type of problem encountered. Kris Jurka