RE: Connection.setBytes()

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Joachim Achtzehnter'" <joachim(at)kraut(dot)bc(dot)ca>, pgsql-interfaces(at)postgresql(dot)org
Subject: RE: Connection.setBytes()
Date: 2000-07-19 06:56:21
Message-ID: 1B3D5E532D18D311861A00600865478CF1B0F4@exchange1.nt.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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(at)kraut(dot)bc(dot)ca]
Sent: Tuesday, July 18, 2000 8:48 PM
To: pgsql-interfaces(at)postgresql(dot)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

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 2000-07-19 06:59:03 RE: Searching Blobs
Previous Message Peter Mount 2000-07-19 06:54:38 RE: Connection.setBytes()