i get this error when calling a mysql Prepared Statement every 30 seconds this is the code which is been called:
public static int getUserConnectedatId(Connection conn, int i) throws SQLException {
pstmt = conn.prepareStatement("SELECT UserId from connection where ConnectionId ='" + i + "'");
ResultSet rs = pstmt.executeQuery();
int id = -1;
if (rs.next()) {
id = rs.getInt(1);
}
pstmt = null;
rs = null;
return id;
}
not sure what the problem is :s thanks in advanced.