pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Altaf Malik <mmalik_altaf@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: JDBC causing the connection to close after executing a COPY command
Date: Thu, 13 Dec 2007 07:24:57 -0800 (PST)
Message-ID: <669991.48395.qm@web39114.mail.mud.yahoo.com> (raw)
In-Reply-To: <Pine.BSO.4.64.0712072303540.21112@leary.csoft.net>

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?

Thanks,
Altaf Malik
EnterpriseDB
http://www.enterprisedb.com/

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

view thread (9+ messages)  latest in thread

Message-ID: <669991.48395.qm@web39114.mail.mud.yahoo.com>
Permalink:  ../669991.48395.qm@web39114.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/669991.48395.qm@web39114.mail.mud.yahoo.com

 · 

reply

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: mmalik_altaf@yahoo.com
  Subject: Re: JDBC causing the connection to close after executing a COPY command
  In-Reply-To: <669991.48395.qm@web39114.mail.mud.yahoo.com>
  References: <Pine.BSO.4.64.0712072303540.21112@leary.csoft.net> <669991.48395.qm@web39114.mail.mud.yahoo.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