Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AD69A9FBC5F for ; Mon, 29 Oct 2007 17:45:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 43169-02-2 for ; Mon, 29 Oct 2007 17:45:13 -0300 (ADT) X-Greylist: delayed 01:00:12.289965 by SQLgrey-1.7.5 Received: from mail.nqadmin.com (mail.liquidcore.com [70.151.60.104]) by postgresql.org (Postfix) with ESMTP id A6BB09FBD1D for ; Mon, 29 Oct 2007 17:45:12 -0300 (ADT) Received: (from root@localhost) by mail.nqadmin.com (8.14.1/8.14.1) id l9TJiplP020281 for pgsql-jdbc@postgresql.org; Mon, 29 Oct 2007 14:44:51 -0500 Received: from ppasalalinux.nqadmin.com (ppasalalinux.nqadmin.com [192.168.0.234]) by mail.nqadmin.com with SMTP; for pgsql-jdbc@postgresql.org; Mon, 29 Oct 2007 14:44:51 -0500 (CDT) (envelope-from dbadmin@nqadmin.com) Message-ID: <4726383A.8060909@nqadmin.com> Date: Mon, 29 Oct 2007 14:44:58 -0500 From: Prasanth Reddy Reply-To: dbadmin@nqadmin.com User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: getXXX throws SQLException while on insert row Content-Type: multipart/alternative; boundary="------------010204000700050307030603" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200710/172 X-Sequence-Number: 17744 This is a multi-part message in MIME format. --------------010204000700050307030603 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, Should the below code throw an SQLException? rs.moveToInsertRow(); rs.updateInt("account_id", 1023); rs.getInt("account_id"); - shouldn't this return 1023 rather than throwing SQLException? Below is the exception: org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2473) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1903) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getFixedString(AbstractJdbc2ResultSet.java:2404) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:2012) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:2226) Postgres Server version: 8.1 JDBC Driver version: 8.1-410 JDBC 3 Thanks, -Prasanth. --------------010204000700050307030603 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi,

Should the below code throw an SQLException?

rs.moveToInsertRow();
rs.updateInt("account_id", 1023);
rs.getInt("account_id");      - shouldn't this return 1023 rather than throwing SQLException?

Below is the exception:
org.postgresql.util.PSQLException: ResultSet not positioned properly, perhaps you need to call next.
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2473)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1903)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getFixedString(AbstractJdbc2ResultSet.java:2404)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:2012)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:2226)



Postgres Server version: 8.1
JDBC Driver version: 8.1-410 JDBC 3

Thanks,
-Prasanth.
--------------010204000700050307030603--