AndroidDev
AndroidDev

Reputation: 16385

JDBC SQL Server Out of Memory Exception

I am writing a small utility that index's a SQL Server 2005 table data to LUCENE data store. i am using a JDBC SQL Server driver for connectivity. The result set returned from the server has around 2 million rows. This always throws a Out of Memory Exception. I have increased the Heap size for the client machine to around 1.6 GB, but to no avail. How can i fetch such large data sets, using JDBC giving limited memory .

Kind Regards

Upvotes: 2

Views: 562

Answers (1)

Mark Leighton Fisher
Mark Leighton Fisher

Reputation: 5693

Have you looked at LIMIT and TOP in SQL? Also, try Googling for phrases like 'SQL query pagination'.

Upvotes: 1

Related Questions