Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B6ACF2E0281 for ; Thu, 13 Dec 2007 11:25:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 59347-01 for ; Thu, 13 Dec 2007 11:24:59 -0400 (AST) Received: from web39114.mail.mud.yahoo.com (web39114.mail.mud.yahoo.com [209.191.87.233]) by postgresql.org (Postfix) with SMTP id 64C272E0235 for ; Thu, 13 Dec 2007 11:24:59 -0400 (AST) Received: (qmail 48542 invoked by uid 60001); 13 Dec 2007 15:24:57 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=p/8/nt4PecNHsLcCKc6QPz2W5uQxeueY02QLRXEbxsiDxLywG11YkjKmeBAwjclvsC0dmVhzC83UPu4+6Rciblsq415y1t+rmcePMSZlcWhtIpKtgkh6voAvNeEEdTU922DFpebyHeiVKTjyOZdCuBdSIhQZG8Q3vKyoJUYJh1o=; X-YMail-OSG: d4c7mawVM1lF45R_hoXPF4kA8_xmOR9uCT0j_3tP18i95PbsDUs5wQsTJ8lUHEWwLMaCdn8tGsGSNbjIEnuWPCFYMnSGBV6Qvpa5vay9ezYpCtQ0DIbNzgCt4AOmdA-- Received: from [58.65.169.82] by web39114.mail.mud.yahoo.com via HTTP; Thu, 13 Dec 2007 07:24:57 PST Date: Thu, 13 Dec 2007 07:24:57 -0800 (PST) From: Altaf Malik Subject: JDBC causing the connection to close after executing a COPY command To: pgsql-jdbc@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1285828184-1197559497=:48395" Content-Transfer-Encoding: 8bit Message-ID: <669991.48395.qm@web39114.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/84 X-Sequence-Number: 17939 --0-1285828184-1197559497=:48395 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. 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"); 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. --0-1285828184-1197559497=:48395 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-1285828184-1197559497=:48395--