public void storeFormResponse(int userId, int formId, FormResponse resp) throws
            VoteNotStoredException, InvalidVotingUserException, FormNotFoundException, UserAlreadyVotedException {
        try {
            if(!this.isValidFormVoter(userId, formId)) {
                throw new InvalidVotingUserException();
            }
            else if(!this.formExists(formId)) {
                throw new FormNotFoundException("Cannot find form");
            }
            else if(this.alreadyVoted(userId, formId)) {
                throw new UserAlreadyVotedException();
            }
            else {
                String q2 = "insert into formresponse values(?, ?, ?);";
                PreparedStatement st2 = conn.prepareStatement(q2);
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                ObjectOutputStream oout = new ObjectOutputStream(baos);
                oout.writeObject(resp);
                oout.close();
                st2.setInt(1, formId);
                st2.setInt(2, userId);
                st2.setBytes(3, baos.toByteArray());
                st2.executeUpdate();
                conn.commit();
            }
         }
        catch(IOException e) {
            e.printStackTrace();
            try {
                conn.rollback();
            } catch(Exception e2) {
                e2.printStackTrace();
                System.out.println("Vote possibly contaminated!");
            }
            throw new VoteNotStoredException("Error storing vote");
        }
        catch(SQLException e2) {
            try {
                conn.rollback();
            } catch(Exception e3) {
                e2.printStackTrace();
                System.out.println("Vote possibly contaminated!");
            }
            throw new VoteNotStoredException("Error storing vote");
        }

    }