wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes How to use ResultSet Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to use ResultSet Object" Watch "How to use ResultSet Object" New topic

How to use ResultSet Object

fazul kareem

Joined: Jan 24, 2006
Posts: 2
I am currently working on bringing out some nice plots.To be pricise, i am using jfreechart .The user can input from and to dates and that could be even as long as one year or sometimes even 2. In such cases i will have to work with data of the order of (40,000 * 12) rows from the database say for one year..and each row will contain 5 columns..Column 1 is TimeStamp and rest are floats...
In such cases what is the best possible way to go about..I first tried taking the whole data in a resultset.Then i realised that accessing such huge ResultSet object thro rs.get() becomes slow.Then i tried first getting the whole data in resultset and then dumbing it into a 2D array.This made things faster to some extend..But i am confused ? is this the right way? or is there another better way of doing this?

please help me guys..pleeeaazzzzzzzee!! []
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15100

Do you really need all the 40,000 * 12 = 480,000 records to create your chart? Think about what data is really needed to create the output you need, and find out an SQL statement that fetches only the data you need.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link: http://aspose.com/file-tools
subject: How to use ResultSet Object
It's not a secret anymore!