java.lang.OutOfMemoryError: Java heap space

Posted by houlahan on Stack Overflow See other posts from Stack Overflow or by houlahan
Published on 2010-06-10T08:39:34Z Indexed on 2010/06/10 8:42 UTC
Read the original article Hit count: 213

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about jdbc