Skip site navigation (1) Skip section navigation (2)

Re: Exception-handling

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Håkan Jacobsson <hakan(dot)jacobsson99(at)bredband(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Exception-handling
Date: 2006-12-21 14:54:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
The only general rule I adhere to is to make sure you clean up your  
connections in a finally clause

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

In response to


pgsql-jdbc by date

Next:From: Roland WalterDate: 2006-12-21 17:04:40
Subject: Re: Exception-handling
Previous:From: Håkan JacobssonDate: 2006-12-21 10:01:21
Subject: Exception-handling

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group