public Integer[] getAllUserFormIds(int userId) {
        try {
           String q = "select * from form where ownerid = ?";
            PreparedStatement st = conn.prepareStatement(q);
            st.setInt(1, userId);
            ResultSet rs = st.executeQuery();
            conn.commit();
            ArrayList <Integer> forms = new ArrayList<Integer>();
            while(rs.next()) {
                forms.add(rs.getInt(1));
            }
            //System.out.println(forms);
            return forms.toArray(new Integer[forms.size()]);
        } catch(SQLException e) {
            e.printStackTrace();
            try {
                conn.rollback();
            } catch(Exception e2) {
                e2.printStackTrace();
            }
            return new Integer[0];
        }
    }