> Thanks for every ones replies to make the question more clear this
> what i wanted from the code
[quoted text clipped - 4 lines]
> {
> prepareStatment= conn.prepareStatement(sql.toString()),
Why are you calling String.toString() ?
> ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
> prepareStatment.setMaxRows(resultNumber);
Wouldn't a better name for the second parameter be "maxRows"?
> resultset = prepareStatment.executeQuery();
> rowsdc = new RowSetDynaClass(resultset);
>
> }
I noticed you don't actually return anything from this method.
> So the user gets back a result for the first 10 rows, now the user
> again requests another set of 10 rows. This method is again called and
> here is the real problem starts he now wants to get results from 11-20.
> Simply put the question is how to maintain the state of the results
> with out modifying the query the user inputs??
How about creating an object which maintains its own state and returning
that?
- Oliver
smartnhandsome@gmail.com - 30 Aug 2006 20:29 GMT
Thanks Oliver its just snippet yes I do return the object ...I did not
really get what you mean when you say "object that does its own session
management" can you please elaborate
Oliver Wong - 30 Aug 2006 20:34 GMT
> Thanks Oliver its just snippet yes I do return the object ...I did not
> really get what you mean when you say "object that does its own session
> management" can you please elaborate
Return an object which provides an API for the client to read 10 rows at
a time. This object will keep track of where the client currently is in the
overall result set.
This is similar to the behaviour of the object returned by the
List.iterator().
- Oliver
steve - 30 Aug 2006 23:06 GMT
>> Thanks Oliver its just snippet yes I do return the object ...I did not
>> really get what you mean when you say "object that does its own session
[quoted text clipped - 8 lines]
>
> - Oliver
there is no need for this complexity, it is all built in.
all that it requires is for the poser to actually READ the oracle
documentation.
it is not as if he is the only person to want to do this, there are thousands
of clients with this requirement, and it is all controllable from the JDBC
driver.
steve