pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Thomas Finneid <tfinneid@fcon.no>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: jdbc excpetions in pg
Date: Wed, 3 Jun 2009 16:19:05 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.0906031617300.2432@leary.csoft.net> (raw)
In-Reply-To: <2855.89.8.146.200.1244042913.squirrel@fcon.no>
References: <2855.89.8.146.200.1244042913.squirrel@fcon.no>



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



view thread (3+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.0906031617300.2432@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.0906031617300.2432@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.0906031617300.2432@leary.csoft.net

 · 

reply

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: books@ejurka.com, tfinneid@fcon.no
  Subject: Re: jdbc excpetions in pg
  In-Reply-To: <alpine.BSO.2.00.0906031617300.2432@leary.csoft.net>
  References: <2855.89.8.146.200.1244042913.squirrel@fcon.no> <alpine.BSO.2.00.0906031617300.2432@leary.csoft.net>

* 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