X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 768395E4077 for ; Sun, 8 Aug 2004 01:10:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26744-06 for ; Sun, 8 Aug 2004 04:10:26 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 27C6E5E37CD for ; Sun, 8 Aug 2004 01:10:16 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i784AOiG029125 for ; Sun, 8 Aug 2004 04:10:24 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i7842FNw027031 for pgsql-jdbc@postgresql.org; Sun, 8 Aug 2004 04:02:15 GMT From: ng@maritimesource.ca (Justin Kennedy) X-Newsgroups: comp.databases.postgresql.interfaces.jdbc Subject: executing batch select queries Date: 7 Aug 2004 21:02:14 -0700 Organization: http://groups.google.com Lines: 37 Message-ID: <802eaf32.0408072002.400e4538@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/61 X-Sequence-Number: 10783 Hi, Short version: How can I do batch select queries with jdbc-postgresql? Long version: I'm migrating a transaction management system from Oracle to PostgreSQL. We use batch select queries quite a bit, and to accomplish this in Oracle we just separated the queries with "\n" and ran: stmt.executeQuery(sql). Doing this in PostgreSQL (with a semicolon as a delimeter) generates this error: Cannot handle multiple result groups. So then I figured it wasn't supported and looked up the 'executeBatch' function, but now that leads me to this problem: This works: stmt.executeQuery("select * from pay_methods"); But this doesn't: stmt.clearBatch(); stmt.addBatch("select * from pay_methods"); stmt.executeBatch(); The following error is output: Batch entry 0 .... Call getNextException() to see the cause. calling getNextException() produces this: A result was returned when none was expected. Please advise me on how to accomplish batch select queries. Thanks for the help, -Justin