JDBC ResultSet

From: Stoffel van Aswegen <Stoffelva(at)gmsi(dot)co(dot)za>
To: "PostgreSQL Mailing List (E-mail)" <pgsql-novice(at)postgresql(dot)org>
Subject: JDBC ResultSet
Date: 2001-10-09 09:30:55
Message-ID: 9D8BB61A24FCD0118E83080036CE960301491D91@ntserver01.gmsi.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have the following Java code:

---snip---
ResultSet rst = pgConnection.openResultSet("SELECT foo, bar from
table1");
while (rst.next))
System.out.println(rst.getString("foo"),
rst.getString("bar"));
---snip---
[I'm writing from memory - not sure if openResultSet is the correct method
name.]

This always only prints _one_ record, which is also the last record. The
docs say that the cursor opens before the first record, so I must be doing
something wrong.

I am using PostgreSQL 6.5 database (yes, I know it's old, but I'm only
playing/learning/prototyping/...) Surely, this is not a pg6.5 problem? Or is
it?

I'd appreciate any pointers.
TIA

Stoffel van Aswegen
import signature.*;

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Travis Hoyt 2001-10-09 13:24:26 Rules and Views
Previous Message Stephan Szabo 2001-10-09 07:44:16 Re: Corrupted table . . .