JDBC ResultSet - Mailing list pgsql-novice

From Stoffel van Aswegen
Subject JDBC ResultSet
Date
Msg-id 9D8BB61A24FCD0118E83080036CE960301491D91@ntserver01.gmsi.co.za
Whole thread Raw
Responses Re: JDBC ResultSet  ("Josh Berkus" <josh@agliodbs.com>)
List 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.*;


pgsql-novice by date:

Previous
From: "Stephan Szabo"
Date:
Subject: Re: Corrupted table . . .
Next
From: "Travis Hoyt"
Date:
Subject: Rules and Views