JDBC causing the connection to close after executing a COPY command

Поиск
Список
Период
Сортировка
От Altaf Malik
Тема JDBC causing the connection to close after executing a COPY command
Дата
Msg-id 669991.48395.qm@web39114.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: JDBC driver patch for non-ASCII users  (Kris Jurka <books@ejurka.com>)
Ответы Re: JDBC causing the connection to close after executing a COPY command  (Dave Cramer <pg@fastcrypt.com>)
Re: JDBC causing the connection to close after executing a COPY command  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
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.

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Synthesize support for Statement.getGeneratedKeys()?
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: JDBC causing the connection to close after executing a COPY command