Exemplo n.º 1
0
 public RiderModel getOneRider(String id)
     throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException,
         ParseException {
   ResultSet result = DB.getResultSet("SELECT * FROM riders WHERE riders.id = " + id + ";");
   RiderModel rider = this.fillModel(result).get(0);
   DB.closeCon();
   return rider;
 }
Exemplo n.º 2
0
  public List<RiderModel> getRiderByCount(String id, String count)
      throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException,
          ParseException {
    ResultSet result =
        DB.getResultSet(
            "select * from riders where id != " + id + " order by id desc limit " + count + ";");
    List<RiderModel> riderList = new LinkedList<>();
    while (result.next()) {
      RiderModel temp = new RiderModel();

      temp.setId(result.getInt("id"));
      temp.setText(result.getString("text"));
      riderList.add(temp);
    }
    DB.closeCon();
    return riderList;
  }