permaculture playing cards
The moose likes JDBC and Relational Databases and the fly likes SQL Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "SQL Exception " Watch "SQL Exception " New topic

SQL Exception

Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
Hi All,
I am facing an starnge problem.
My psuedo code,

1. A Query to Retreive the Records satisfying particular condition.
2. For each record retreived above i have a for loop to itreate it and do the following operations.
3. Inside For loop-
Write a prepared statement and execute it to get users associated with that which is multiple.
4. Based on the users got i build a comlplex query with the values retrived in above process and execute it to get the resultset.
5.I store the values in arraylist
6. Repeat the above process unitill all the records are handled.

If the no. of records are less, its working fine. But it exceeds around 60 i get the following exception- Not enough storage is available in the application heap to process the statement.

Can any one suggest a solution to overcome this problem.

Thanks in advance.

Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
This is just a wild guess, but it sounds like either cursor problems, an unanticipated set of conditions, or unclosed resources. Have you placed printlns strategically? ... especially with different counts?


George Stoianov
Ranch Hand

Joined: Jan 15, 2006
Posts: 94
You can also check your queries and make sure you are not executing a cartesian join on two huge tables. It maybe that the resulting object pushed as return from the db to your java object is too big and java cannot store it.

I agree. Here's the link:
subject: SQL Exception
It's not a secret anymore!