java.lang.OutOfMemoryError
I have a Query Builder page in which the user can create queries to our local database and view results. I have a general data access class which store the results from a query in an 2d array. When I try to grab everything (select * ..) from a table, I get an OutOfMemoryError. The table has roughly 6200 rows and 34 columns. I assume this if because I am using arrays? What would be the best implementation process?
If I used a Vector, each object stored in the Vector would have to be a row, thus would have the be an array to each columns value. Would this prevent the OutOf Memory Error and be proper practice?
Thank you!
[645 byte] By [
vinays84a] at [2007-11-27 5:48:45]

Actually an List would increase the amount of space required. Avoid slurping up the whole table at one go, or if you must, you'll probably need to increase the memory limit with something like -Xmx256m added to the java command (before the -jar or class name).
Could be blobs, it could also be something stupid like not incrementing the result set always adding the same one to the db, a bit hard to tell without getting a look at some code.
I grabbed all the data at once in the Result Set, setting the fetch size of the statement object to 7000. I did this so I could know the row count to initialize the array length. Thus, there was no incrementation and only one added.
Why jump through any additional hoops to use an array, when it is so easy to use a collection like a List?Not that using a list will make much of a memory footprint difference, I'm just saying...