Hello,
We want to upgrade to DB2 9.7.
But we keep getting memory leaks in java.
We have tried the jdbc3 and jdbc4 drivers (latest _3a version march 2011) but both have the same problem.
If we run the code underneath, memory usage keeps on going up until we get an outofmemory error
Code:
Connection dbConnection = DriverManager.getConnection("jdbc:db2://server:50000/database", "username", "password");
dbConnection.setAutoCommit(false);
PreparedStatement insertStatement = dbConnection.prepareStatement("INSERT INTO table (ID, TIMESTAMP_RECEIVED) VALUES(?, ?)");
int i = 0;
while (true) {
insertStatement.setString(1,""+i++);
insertStatement.setTimestamp(2,new Timestamp(System.currentTimeMillis()));
insertStatement.execute();
insertStatement.clearParameters();
insertStatement.clearWarnings();
dbConnection.commit();
if (i % 10000 ==0){
System.out.println("inserts = " + i);
}
}
Did someone also have these problems, or does someone know what's going wrong?
Thanks in advance, Tinie