Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Process Large Resultset Using Java

824384Dec 16 2010 — edited Dec 21 2010
Hi,
I have a table with two columns which can have millions of records. In which one column is unique and other column(VARCHAR2) will hold values delimited by comma.(Eg., Value1,Value2,Value3).

Sample Data table

Table1

Column1 Column2

T1 - Notes1
T2 - Notes2
T3 - Notes3,Notes4,Notes1
T4 - Notes5.

Output_

Table2

Column1 LinkToColumn2(Generated)
T1 - 1
T2 - 2
T3 - 3,4,5
T4 - 5

Table3

LinkToColumn2(Generated) Column2 (Splited using delimiter and distinct value)

1 - Notes1
2 - Notes2
3 - Notes3
4 - Notes4
5 - Notes5

At Present , I am using HashMap for holding Table2 and ArrayList for Table3 where LinkToColumn2(Generated) is the index of the list.

Now i have 1lac records in my table.

I am getting java.lang.OutOfMemoryError: Java heap space while running my code.

I need to hold all the data in memory. I had increased the Heap Size of the JVM till 1.25GB which didn't helped me out. Please suggest me any workaround for this??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2011
Added on Dec 16 2010
9 comments
1,773 views