pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Håkan Jacobsson <hakan.jacobsson99@bredband.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Exception-handling
Date: Thu, 21 Dec 2006 09:54:35 -0500
Message-ID: <021E5266-98FD-4ECD-8CFD-FBEFE0CAA761@fastcrypt.com> (raw)
In-Reply-To: <20061221100121.EJOZ10325.mxfep02.bredband.com@mxfep02>
References: <20061221100121.EJOZ10325.mxfep02.bredband.com@mxfep02>

The only general rule I adhere to is to make sure you clean up your  
connections in a finally clause

Dave
On 21-Dec-06, at 5:01 AM, Håkan Jacobsson wrote:

> Hi,
>
> I'm working against a postgresql database (version 8.0 ).
> I was wondering how to handle exceptions properly when doing
> database-related stuff, like queries, inserts etc.
>
> Often when I get an exception (I just catch an SQL exception in the  
> catch
> clause) I get a message saying call getNextException(). Should I  
> always add
> this code in the catch clause? Or should I always add a catch for  
> catching
> postgresql-exceptions? Is there a general rule for this?
>
>
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>                 http://www.postgresql.org/about/donate
>




view thread (4+ messages)  latest in thread

Message-ID: <021E5266-98FD-4ECD-8CFD-FBEFE0CAA761@fastcrypt.com>
Permalink:  ../021E5266-98FD-4ECD-8CFD-FBEFE0CAA761@fastcrypt.com/
Also on:    postgresql.org/message-id/021E5266-98FD-4ECD-8CFD-FBEFE0CAA761@fastcrypt.com

 · 

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: pg@fastcrypt.com, hakan.jacobsson99@bredband.net
  Subject: Re: Exception-handling
  In-Reply-To: <021E5266-98FD-4ECD-8CFD-FBEFE0CAA761@fastcrypt.com>
  References: <20061221100121.EJOZ10325.mxfep02.bredband.com@mxfep02> <021E5266-98FD-4ECD-8CFD-FBEFE0CAA761@fastcrypt.com>

* 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