pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Felix Morley Finch <felix@crowfix.com>
To: pgsql-interfaces@postgresql.org
Subject: Problem with jdbc, nextval ('myseq'), and rs.getInt (1) - SOLVED
Date: 10 May 1998 00:16:11 -0000
Message-ID: <19980510001611.19433.qmail@crowfix.com> (raw)

Well, heck, if I ever need proof I'm not perfect, I just got it :-)

I had this code which gave me a null pointer exception with clumn 1,
or SQLException for column 0:

	seq.execute ("SELECT nextval ('myseq')");
	ResultSet rs = seq.getResultSet ();
	id = rs.getInt (1);

The problem was, I had forgotten to include this statement --

	rs.next ();

which makes it all work fine.

Doh!

-- 
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
  PGP = 91 B3 94 7C E9 E8 76 2D   E1 63 51 AA A0 48 89 2F  ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o



Message-ID: <19980510001611.19433.qmail@crowfix.com>
Permalink:  ../19980510001611.19433.qmail@crowfix.com/
Also on:    postgresql.org/message-id/19980510001611.19433.qmail@crowfix.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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: felix@crowfix.com
  Subject: Re: Problem with jdbc, nextval ('myseq'), and rs.getInt (1) - SOLVED
  In-Reply-To: <19980510001611.19433.qmail@crowfix.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