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 BFD773A5ED1 for ; Thu, 27 Jan 2005 14:01:09 +0000 (GMT) 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 62926-04 for ; Thu, 27 Jan 2005 14:00:59 +0000 (GMT) Received: from outmail.unitedplanet.de (guardian.unitedplanet.de [212.185.176.178]) by svr1.postgresql.org (Postfix) with ESMTP id 061033A5EE2 for ; Thu, 27 Jan 2005 14:01:01 +0000 (GMT) Received: from Apollo.unitedplanet.de (apollo.unitedplanet.de [10.10.12.17]) by outmail.unitedplanet.de (Postfix) with ESMTP id DA80A2AC8C for ; Thu, 27 Jan 2005 16:11:39 +0100 (CET) Received: from mklinux.spec.unitedplanet.de ([10.10.15.19]) by Apollo.unitedplanet.de with Microsoft SMTPSVC(6.0.3790.211); Thu, 27 Jan 2005 15:01:01 +0100 From: Martin Keller To: pgsql-jdbc@postgresql.org Subject: moveToInsertRow doesn't work when using prepared statements Date: Thu, 27 Jan 2005 15:00:46 +0100 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501271500.46617.martin.keller@unitedplanet.de> X-OriginalArrivalTime: 27 Jan 2005 14:01:01.0298 (UTC) FILETIME=[A2270520:01C50478] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200501/271 X-Sequence-Number: 12151 Hello, calling moveToInsertRow on a ResultSet returned by a prepared statement leads to a NullPointerException: Example code: PreparedStatement p = c.prepareStatement( "SELECT * FROM sampletable WHERE myid=?", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); p.setInt(1,1); ResultSet r = p.executeQuery(); r.moveToInsertRow(); Result: Exception in thread "main" java.lang.NullPointerException at org.postgresql.core.v3.SimpleQuery.toString(SimpleQuery.java:40) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.parseQuery(AbstractJdbc2ResultSet.java:1656) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.isUpdateable(AbstractJdbc2ResultSet.java:1516) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkUpdateable(AbstractJdbc2ResultSet.java:2427) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.moveToInsertRow(AbstractJdbc2ResultSet.java:868) Driver Version: 8.0.309 JDBC3 PostgreSQL Version: 7.4.6 Best regards Martin Keller