Hello,
I get a out of memory error on line 4:
int isDeleted = 0;
PreparedStatement psDeleteRecord=null;
try {
psDeleteRecord=con.prepareStatement(delQuery);
isDeleted = psDeleteRecord.executeUpdate();
if(isDeleted !=1){
echoLog("Could not Delete: " + delQuery);
}
else {
numDel++;
}
}
catch (SQLException s) {
echoLog("Failed: " + delQuery);
s.printStackTrace();
}
This block of code inside a while loop. Could some one explain to me why I am getting this error? Isn't PreparedStatement psDeleteRecord destroyed every time I loop?
The Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at net.sourceforge.jtds.jdbc.RequestStream.<init>(RequestStream.java:72)
at net.sourceforge.jtds.jdbc.SharedSocket.getRequestStream(SharedSocket.java:409)
at net.sourceforge.jtds.jdbc.TdsCore.<init>(TdsCore.java:440)
at net.sourceforge.jtds.jdbc.JtdsStatement.<init>(JtdsStatement.java:176)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.<init>(JtdsPreparedStatement.java:99)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java:2456)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java:2414)
at monmouthpics.Main.main(Main.java:63)