File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC - number of records fetched Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC - number of records fetched" Watch "JDBC - number of records fetched" New topic
Author

JDBC - number of records fetched

Narasimha Rao B.
Ranch Hand

Joined: Aug 26, 2002
Posts: 205
Hi, can anyone tell me why is it that I am not able to get all the data from a database table at one shot and then iterate through the data through my code ?

I have to get around data in one columns for 5000 records from the database in US to my application in India and iterate through the records and store the value in a Vector.

If there are some documents already available, please provide reference to that. I am using JDBC 2.0.


Thanks in advance.


Narasimha
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30917
    
158

Narasimha,
You should be able to do that. I would question why you need all that data because you don't want to transmit data that you are not going to use.

Are you having a specific problem when trying to get the data?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Narasimha Rao B.
Ranch Hand

Joined: Aug 26, 2002
Posts: 205
Yes, I have a specific requirement,
I need all the data, iterate through the values and based on some
particular logic, needs to identify certain values that satisfies certain conditions and use it in the next query thats fired.

If you have some idea of achieving this, request you to let me know.

By default, it gets me only certain set of records and once I finish iteration on this set, it fetched the next set of data.

Thanks & Regards
Narasimha
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30917
    
158

Narasimha,
If you can employ any more filtering in the where clause, do that. But it sounds like you already tried.

Another thing to suggest is to do your logic check in a stored procedure. That way all the data doesn't need to be transmitted. If you don't have control over the remote database or the network, there isn't much you can do.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC - number of records fetched