I was running my test harness code to create a new user. I had a number of poorly coded sql statements causing exceptions, and eventually i came to a point where the derby database server gave up.

Make sure that when you catch SQLException and continue running,
that you close the various JDBC objects that you were using. In
particular, if you execute a query and create a ResultSet, close
the ResultSet, and if you create a Statement or PreparedStatement,
close the statement.

You can't open an infinite number of statements and result sets,
so try to be sure to close them when you are done with them.

See if that helps your program run longer without running out of memory.

thanks,

bryan

Reply via email to