Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use ResultSet Object

 
fazul kareem
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic