public boolean formExists(int formId) {
        try {
            String q = "select count(*) from form where formid = ?;";
            PreparedStatement st = conn.prepareStatement(q);
            st.setInt(1, formId);
            ResultSet rs = st.executeQuery();
            conn.commit();
            rs.next();
            return rs.getInt(1) > 0;
        } catch(Exception e) {
            try {
                e.printStackTrace();
                conn.rollback();
            } catch(Exception e2) {
                e2.printStackTrace();
            }
            return false;
        }

    }