JDBC ResultSet essentially works off of a single row pointer. What that
means is, at a given point in time, you can only operate on a "single"
row in a resultset. Sure you can move the pointer back and forth based
on the scrollable settings, but thats pretty much it. You will have to
keep doing rs.next() to iterate through the whole result set.
-cheers,
Manish
> Hi,
>
[quoted text clipped - 23 lines]
> Sarath.B
> , but you had better keep it generic
then I am afraid you will have to write one.
, but you had better keep it generic, do not assume that you will always
play with 'int'
use an array of objects and return rs.object(n) as in
record[i] = rset.getObject(1 + i);
to return 1 record
and
record[i] = rset.getObject(1 + i);
// COPY THE DATA TO A LOCAL ARRAY OF THE RIGHT SIZE
}
loop++;
Arraydata.add(record);
to return an array of records.
Do not type convert in your get routines. if later you need to code reuse or
modify your table, you will seriously be buggered up, ESP. if you change the
order of your select statement.
keep your record data & type intact, and only convert for input or display,
then when you go to put it back into the database , it will slide right in,
because you have not "type" converted your data.
Do not assume that just because you can get an int from the database, that
you can automatically put an int back.
Steve
Sarath - 16 Nov 2006 08:39 GMT
> > Hi,
> >
[quoted text clipped - 56 lines]
>
> Steve
Yes , I agree.
The method has to be generic.
Thanks for the comments.