pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Prasanth Reddy <dbadmin@nqadmin.com>
To: pgsql-jdbc@postgresql.org
Subject: getXXX throws SQLException while on insert row
Date: Mon, 29 Oct 2007 14:44:58 -0500
Message-ID: <4726383A.8060909@nqadmin.com> (raw)

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.
<http://jdbc.postgresql.org/download/postgresql-8.1-410.jdbc3.jar;

view thread (6+ messages)  latest in thread

Message-ID: <4726383A.8060909@nqadmin.com>
Permalink:  ../4726383A.8060909@nqadmin.com/
Also on:    postgresql.org/message-id/4726383A.8060909@nqadmin.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: dbadmin@nqadmin.com
  Subject: Re: getXXX throws SQLException while on insert row
  In-Reply-To: <4726383A.8060909@nqadmin.com>
  References: <4726383A.8060909@nqadmin.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox