[geeks] Problem with JDBC

Sridhar Ayengar ploopster at gmail.com
Thu Nov 20 20:18:52 CST 2008


I have this Java problem I've been beating my head against for a couple 
of days.

I am trying to read a table out of Oracle and turning it into a two 
dimensional Vector.  A Vector<Vector<Object>> actually.

I've used this code for the same purpose on other tables many times in 
the past, but never run into this problem.  The SQL that selects the 
table returns a ResultSet properly.  However, halfway though extracting 
the Objects from the ResultSet, the JApplet's memory usage starts 
increasing meteorically until it crashes with an OutOfMemoryError when 
it runs out of heap space.  At the point where it crashes, it's using 
roughly 160MB RAM.

The problem is that the table is only about 800kB in total, made up of 
about 2000 records.  That's pretty small.  The database is Oracle 9i, 
and I've tried a couple of different versions of the Oracle JDBC driver, 
without any luck.

Any ideas?  I'm past my deadline already on this project.  I'm thinking 
of trying this with a fixed two-dimensional array instead of a Vector, 
but I'm not sure it would make any difference, since, if memory serves, 
a Vector is implemented as an array under the covers.

Peace...  Sridhar



More information about the geeks mailing list