Yes, now I look more closely yes, the finally clause does close the
connection, which is why you get the NullPointerException.
Peter
--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council
-----Original Message-----
From: Joachim Achtzehnter [mailto:joachim@kraut.bc.ca]
Sent: Tuesday, July 18, 2000 8:48 PM
To: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] Connection.setBytes()
On Tue, 18 Jul 2000, Matt Fair wrote:
>
> Here is the code I am using:
>
> public PsqlConsole(String url) {
> try{
> ...
> con = DriverManager.getConnection("jdbc:postgr...");
> con.setAutoCommit(false);
> }
> catch(ClassNotFoundException e) {
> ...
> }
> catch(SQLException e) {
> ...
> }
> finally {
> //always close the database
> try {
> if(con != null) con.close();
This closes the connection! Once this method returns your connection is
closed. Your subsequent SQL calls in the prompt() method use a closed
connection.
Joachim