Guest User

Untitled

a guest
Dec 7th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public BigDecimal getNumDaysBooked(){
  2. try{
  3. Connection conn = null;
  4. conn = SQL.createConnection(conn, SQL.WOMSDB);
  5. String query = "SELECT TO_DAYS(ReturnDate) - TO_DAYS(SailDate) from reservations where folio=" + container.getCurrentReservation().getFolio();
  6.  
  7. ResultSet RS = null;
  8. Statement stmt = conn.prepareStatement(query);
  9. RS = stmt.executeQuery(query);
  10. /*while (RS.next()) {
  11. results.add(RS.getString(1));
  12. }*/
  13. numDaysBooked = RS.getBigDecimal(1);
  14. stmt.close();
  15. SQL.destroyConnection(conn,"getNumDaysBooked");
  16. }
  17. catch (Exception ex){
  18. System.out.println("error initializing numDaysBooked: " + ex.getMessage());
  19. }
  20.  
  21. return numDaysBooked;
  22. }
Add Comment
Please, Sign In to add comment