on periodical (very short) bases I running Statement or PreparedStatement against MySql db (if isn't it thoroughly cleaned, then during the day I get "nice JavaHeap Memory")
if there way to get list of unclosed Statement(ResultSet) or PreparedStatement, similair way I load(write) from(to) db
private void saveAppStatus(final String text) {
Runnable doRun = new Runnable() {
public void run() {
try {
String addQuery = ("insert into sheduledtasks(Narrative) values (?)");
pstmt = DbConnection.dbConn.prepareStatement(addQuery);
pstmt.setString(1, text + " at: " + PassTime.getTime());
pstmt.executeUpdate();
try {
pstmt.close();
pstmt = null;
} catch (SQLException ex) {
Logger.getLogger(GuiFrame.class.getName()).log(Level.SEVERE, null, ex);
//JOptionPane.showMessageDialog(null, ex + "\n" + "Can't close Pstmt");
}
} catch (Exception ex) {
Logger.getLogger(GuiFrame.class.getName()).log(Level.SEVERE, null, ex);
//JOptionPane.showMessageDialog(null, ex + "\n" + "Communications with Database or Table was broken");
}
}
};
SwingUtilities.invokeLater(doRun);
}