예제 #1
0
 /* Create a trip task */
 public boolean createTripTask(TripTask newTripTask) {
   Connection conn = util.getConnection();
   PreparedStatement ps = null;
   try {
     ps = conn.prepareStatement(this.CREATE_NEW_TRIP_TASK_SQL);
     ps.setInt(1, newTripTask.getApplicationId());
     ps.setInt(2, newTripTask.getDeveloperId());
     ps.setInt(3, newTripTask.getStatus());
     ps.execute();
     return true;
   } catch (SQLException e) {
     e.printStackTrace();
     return false;
   } finally {
     try {
       if (ps != null) ps.close();
       if (conn != null) conn.close();
     } catch (SQLException e) {
       e.printStackTrace();
     }
   }
 }
예제 #2
0
 /* Modify the information of trip task */
 public boolean tripTaskInfoModify(TripTask tripTask) {
   Connection conn = util.getConnection();
   PreparedStatement ps = null;
   try {
     ps = conn.prepareStatement(this.CHANGE_TRIP_TASK_INFO_SQL);
     ps.setInt(1, tripTask.getApplicationId());
     ps.setInt(2, tripTask.getDeveloperId());
     ps.setInt(3, tripTask.getStatus());
     ps.setInt(4, tripTask.getId());
     ps.execute();
     return true;
   } catch (SQLException e) {
     e.printStackTrace();
     return false;
   } finally {
     try {
       if (ps != null) ps.close();
       if (conn != null) conn.close();
     } catch (SQLException e) {
       e.printStackTrace();
     }
   }
 }