multiple resource sets - Mailing list pgsql-jdbc

From Rolf Schillinger
Subject multiple resource sets
Date
Msg-id Pine.GSO.4.21.0105021601170.7877-100000@rrzc3.rz.uni-regensburg.de
Whole thread Raw
List pgsql-jdbc
Hi,
I`m having huge troubles using postgresql JDBC.
I do the following:
while (orderlines.next())
                        {
PreparedStatement as_st=db.prepareStatement("SELECT nr,beschreibung,
    beschreibung_2,preis FROM artikel where nr=?");
System.out.println(orderlines.getRow()+" : "+orderlines.getString(2));
}
As result I get:
1 : KKSC025
2 : KKTO045
which is totally okay cause the underlying table data is as follows:
     id     |   nr    | anzahl | eht
------------+---------+--------+-----
 1226969416 | KKSC025 |     22 | BU1
 1226969416 | KKTO045 |     22 | KT

So far so good.
I know want to process the results of that orderlines query by adding:
as_st.setString(1,orderlines.getString(2));
as=as_st.executeQuery();
as.close();
to the above while loop.
Output now looks like:
1 : KKSC025
2 : Nalo schmal 45/50 rauchbraun
1) is still correct while 2) has the value of as_st/as now.
I`m getting desperate on that.
any help would be greatly appreciated.
thanks, Rolf




pgsql-jdbc by date:

Previous
From: Ned Wolpert
Date:
Subject: Returning oid or primary key
Next
From: Ned Wolpert
Date:
Subject: Re: Returning oid or primary key