> Hello Friends....
> I have some problems regarding JDBC.
[quoted text clipped - 6 lines]
> My Problem is ==> How do I get access(Fetch) to those records using
> ResultSet object which has more than 10,000 in numbers ?
Hi Alun
In my table I have More than 10000 Records may be they are in
some lakhs......
I want all of them But one bye one. When I fire SELECT query then
Whether I will get all those lakhs number of record or If i get then
whether I will be able to traverse through that records by using single
ResultSet intherface in JAVA.
I am using pure Java driver for SYBASE.
Thanks
Best Regards
vikas.khengare@gmail.com
Roedy Green - 03 Feb 2006 11:12 GMT
On 2 Feb 2006 23:51:54 -0800, "vikas khengare"
<vikas.khengare@gmail.com> wrote, quoted or indirectly quoted someone
who said :
> In my table I have More than 10000 Records may be they are in
>some lakhs...
for those of you not familiar with Indian units of measure:
one lakh is 100,000.
one crore is 10,000,000

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 03 Feb 2006 11:14 GMT
On 2 Feb 2006 23:51:54 -0800, "vikas khengare"
<vikas.khengare@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>I want all of them But one bye one. When I fire SELECT query then
>Whether I will get all those lakhs number of record or If i get then
>whether I will be able to traverse through that records by using single
>ResultSet intherface in JAVA.
> I am using pure Java driver for SYBASE.
I think the question you are asking is when I ask for large numbers of
records in a result set, do I get the first one right away, or do I
have to wait until it has got them all? You also might be asking if I
abort the query part way through will it still go get the rest?
The answers are YES, and NO.
It may only get 20 at a time or so and not get the next twenty until
you have consumed the previous 20, rather than getting ahead.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
vikas khengare - 03 Feb 2006 12:38 GMT
Hi Roedy....
Thanks for reply...........
No..... I can proceed with few of them..... But before first
slot gets end I want second slots in my ResultSet.
I want all records in every condition So I have to travel all records.
There is no condition that I will get out in middle and I wont req.
rest of them; So I want all records.................
I want to just read all records Not to do Updarion in that........
So slot may be 20 / 200 / 2000 No problem........ But Delay wont
required....
Best Regards
vikas.khengare@gmail.com
vikas_khengare@yahoo.com
Roedy Green - 03 Feb 2006 15:56 GMT
On 3 Feb 2006 04:38:49 -0800, "vikas khengare"
<vikas.khengare@gmail.com> wrote, quoted or indirectly quoted someone
who said :
> No..... I can proceed with few of them..... But before first
>slot gets end I want second slots in my ResultSet.
there is nothing in the SQL standard about how it has to work. You
can figure it out by testing your candidate database with code that
reads one field of each result set record and immediately grabs the
next. Record the times to get each record and plot a histogram of the
distribution. From that you can deduce what is likely going on under
the hood.
See http://mindprod.com/jgloss/timeh.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Thomas Schodt - 03 Feb 2006 18:14 GMT
> Hi Alun
>
> In my table I have More than 10000 Records may be they are in
> some lakhs......
> I want all of them But one bye one.
When you say you want the records one-by-one,
if you are keeping references to all the records you already read
that will give an OutOfMemoryException (given enough data).
jcsnippets.atspace.com - 09 Feb 2006 21:16 GMT
> > Hi Alun
> >
[quoted text clipped - 5 lines]
> if you are keeping references to all the records you already read
> that will give an OutOfMemoryException (given enough data).
There is a rather easy solution to avoid an OutOfMemoryException when
loading tables with an enormous amount of records/data, on the condition
that the table has a unique key (the primary key for example).
Let's assume the primary key field is called "seq".
First you select the first row:
select * from table where seq = (select min(seq) from table);
For each following row, you select:
select * from table where seq = (select min(seq) from table where seq >
previousSeq);
Not a pretty way of doing things, and it will hurt performance a lot, but it
works.
JC
--
http://jcsnippets.atspace.com
a collection of source code, tips and tricks