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 E8F4A542DC for ; Sun, 1 May 2005 14:24:38 -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 04293-07 for ; Sun, 1 May 2005 17:24:37 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 05FFA533BB for ; Sun, 1 May 2005 14:24:36 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 39ED930952; Sun, 1 May 2005 19:22:53 +0200 (MET DST) From: "Nico" X-Newsgroups: pgsql.interfaces.jdbc Subject: executeQuery returns postgresql.stat.result Date: Sun, 1 May 2005 19:24:06 +0200 Organization: Hub.Org Networking Services Lines: 62 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.359 tagged_above=0 required=5 tests=AWL, FORGED_YAHOO_RCVD, PRIORITY_NO_NAME X-Spam-Level: *** X-Archive-Number: 200505/1 X-Sequence-Number: 12832 Hi, When I try try { sql="select * from \"qryMonthsYears\""; java.sql.ResultSet resultset=getQuery(sql,connection.createStatement()); } catch(java.sql.SQLException fout) { java.sql.SQLException foutje=fout.getNextException(); out.println("
SQL fout: "+fout.getMessage()); while(foutje!=null) { out.print("
Ingebedde fout: "+foutje.getMessage()); foutje=fout.getNextException(); } } I get the following exception when I try this: Batch entry 0 select * from "qryMonthsYears"; was aborted. Call getNextException() to see the cause. When I call getNextException(), I get the following result: postgresql.stat.result and stays in the loop. Here is the code for the method getQuery: ResultSet resultset; if(strstatement.startsWith("SELECT")) { resultset=statement.executeQuery(strstatement); if(resultset==null) throw new SQLException("Resultset is null at getQuery()."); if(resultset.getWarnings()==null) return resultset; else { String errmessage=""; while(resultset.getWarnings().getErrorCode()!=0) { errmessage+=resultset.getWarnings().getMessage()+"\n"; resultset.getWarnings().getNextException(); } throw new SQLException("SQL Fout getQuery(): "+errmessage); } } else { connection.setAutoCommit(false); String [] sql=strstatement.split(";"); for(int teller=0;teller