I wrap the closes within the finally() block because of this:
try {... code ...
} catch(SQLException e) {... handle exception here ...
} finally {try { if(rs!=null) rs.close(); if(st!=null) st.close();} catch(SQLException e1) {}
}
Peter
--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council.
-----Original Message-----
From: Joseph Shraibman [mailto:jks@p1.selectacast.net]
Sent: Tuesday, April 18, 2000 7:28 PM
To: Peter Mount
Cc: 'Guillaume Rousse'; pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] where to close statement ?
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.