Re: where to close statement ? - Mailing list pgsql-interfaces

From Guillaume Rousse
Subject Re: where to close statement ?
Date
Msg-id 00041822430000.02798@agathe
Whole thread Raw
In response to Re: where to close statement ?  (Joseph Shraibman <jks@p1.selectacast.net>)
List pgsql-interfaces
Le mar, 18 avr 2000, vous avez �crit :
> Peter Mount wrote:
> 
> > Ah, forgot that bit. I put them under finally as it always gets run,
> > although you have to wrap them in a try{} win finally if the parent
> > method doesn't throw SQLException.
> >
> > Peter
> >
> 
> The problem with that is that close() itself can throw a SQLException so
> you have to wrap it twice.
so we have either :
finally {
try {
if (conn!=null) conn.close();
} catch (SQLException ignore) {}
}
or eventually :
inally {
try {
conn.close();
} catch (Exception ignore) {}
}
The second also deals with NullPointerException
-- 
Guillaume Rousse
Iremia - Universit� de la R�union

Sleep doesn't exists. Just lack of cafeine.


pgsql-interfaces by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: where to close statement ?
Next
From: Joseph Shraibman
Date:
Subject: Re: JDBC: Missing Classes?