From: Dave Cramer <pg@fastcrypt.com>
To: Altaf Malik <mmalik_altaf@yahoo.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC causing the connection to close after executing a COPY command
Date: Thu, 13 Dec 2007 10:37:10 -0500
Message-ID: <33B38B63-7DB9-405B-A808-0152A5DB6295@fastcrypt.com> (raw)
In-Reply-To: <669991.48395.qm@web39114.mail.mud.yahoo.com>
References: <669991.48395.qm@web39114.mail.mud.yahoo.com>
Altaf,
On 13-Dec-07, at 10:24 AM, Altaf Malik wrote:
> Hi,
> JDBC is causing the connection to close on executing a simple COPY
> query which the driver does not support. The code shows that driver
> throws an exception however explicitly the connection is not closed.
> Consider the following case.
> <code>
> Class.forName("org.postgresql.Driver");
> Connection con = DriverManager.getConnection("jdbc:postgresql://
> localhost/postgres","altaf","");
>
> Statement stmt = con.createStatement();
> stmt.execute("create table abc(a int4)");
> try{
> stmt.execute("COPY abc TO STDOUT WITH DELIMITER '|'");
> }catch(Exception e) {
> e.printStackTrace();
> }
> stmt.execute("Select * from abc");
>
> </code>
>
> Can anybody tell what's happening?
>
At what point can you determine the connection is closed ? Can you do
con.createStatement after the exception ?
Dave
> Thanks,
> Altaf Malik
> EnterpriseDB
> http://www.enterprisedb.com/
>
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pg@fastcrypt.com, mmalik_altaf@yahoo.com
Subject: Re: JDBC causing the connection to close after executing a COPY command
In-Reply-To: <33B38B63-7DB9-405B-A808-0152A5DB6295@fastcrypt.com>
References: <669991.48395.qm@web39114.mail.mud.yahoo.com> <33B38B63-7DB9-405B-A808-0152A5DB6295@fastcrypt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox