public boolean alreadyVoted(int userId, int formId) {
        try {
            String q1 = "select count(*) from formresponse where userid = ? and formid = ?;";
            PreparedStatement st1 = conn.prepareStatement(q1);
            st1.setInt(1, userId);
            st1.setInt(2, formId);
            ResultSet rs = st1.executeQuery();
            conn.commit();
            rs.next();
            return rs.getInt(1) > 0;
        } catch (SQLException e) {
            try {
                e.printStackTrace();
                conn.rollback();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            return true;
        }
    }