@Override
    public int getOrder_IDByUser_IDandMaxDate(String userID) {
        Connection conn = null;
        PreparedStatement stmt=null;
         int order_ID=0;
         ResultSet rs = null;
        try {
            conn = dataSource.getConnection();
            stmt = conn.prepareStatement("SELECT ORDER_ID FROM  \"ORDER\" WHERE USER_ID=? AND ORDER_DATE=(select max(ORDER_DATE) from \"ORDER\")");
         stmt.setString(1, userID);
           rs = stmt.executeQuery();
while(rs.next()){//必須要有游標next才取的到值
           order_ID=rs.getInt("ORDER_ID");
}
        } catch (SQLException ex1) {
            throw new RuntimeException(ex1);
        } finally {
              if (rs != null) {
                try {
                    rs.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
               if (stmt != null) {
                try {
                    stmt.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException ex1) {
                    Logger.getLogger(BookDAO.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }
        }
        return order_ID;
    }