Exemplo n.º 1
0
 public Student getStudent(int id) {
   StudentDataHandler dataHandler = new StudentDataHandler();
   ResultSet resultSet = dataHandler.getStudent(id);
   StudentDirector director = new StudentDirector();
   try {
     return director.createBVStudent(resultSet);
   } catch (SQLException e) {
     e.printStackTrace();
     return null;
   }
 }
Exemplo n.º 2
0
  public int createStudent(MultivaluedMap<String, String> formParams) {
    StudentDirector director = new StudentDirector();
    Student student = director.createStudent(formParams);

    StudentDataHandler dataHandler = new StudentDataHandler();

    if (student instanceof BVStudent) {
      return dataHandler.createBVStudent((BVStudent) student);
    } else {
      // TODO create private student (out of scope)
      return 0;
    }
  }