Hi all,
I am quite new to jdbc but i would like to use it for an application that i am making.
I have a table A with fields:
a, b, c, d, e.
i want to get two specific rows, for e=1 or 2(for example).
and i want fields a and b for the first one and c and d for the second one.
I tried to use 2 different resultSets, but i am getting an error, empty result set.
Then i tried to use a single result set, but i cant distinguish the fields that i want.
That would return the values of the first record, even though i use the next command.
I would prefare to have to results sets, since i could just use two different queries to get exactly what i want.
thanks in advance,ilias
I am quite new to jdbc but i would like to use it for an application that i am making.
I have a table A with fields:
a, b, c, d, e.
i want to get two specific rows, for e=1 or 2(for example).
and i want fields a and b for the first one and c and d for the second one.
I tried to use 2 different resultSets, but i am getting an error, empty result set.
Then i tried to use a single result set, but i cant distinguish the fields that i want.
Code:
rs = statement.executeQuery("select * from A where e like '"+t+"' or e like '"+m+"'");
rs.next();
HD = rs.getString("a");
HW = rs.getString("b");
rs.next();
AD = rs.getString("c");
AW = rs.getString("d");
I would prefare to have to results sets, since i could just use two different queries to get exactly what i want.
thanks in advance,ilias