• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

booking Procedure

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application when user selects Booking item from menu it shows a panel for user that displays all field values in JLabels except ownerID that displays in JTextField. In the bottom it has two buttons for moving to next and previous record as well as a combo box that shows all record numbers so user can select any record randomly. then there are buttons for Reservation and Cancellation.

I used cardlayout and in my search result there is an extra column for record numbers so user can know which record (number) he wants to reserve. then my booking form shows one complete record at time but here in this form he can see only one record so he need to see the search results for comparative records. Is this approach reasonable but I observed here many ranchers used JTable for the selection of required record to book.

Other question is this that I am thinking in array of String[] data all values except for OwnerID should be null, ({null, null, null, null, null, gettxtOwnerID().getText().trim()} ) then pass this to update method there it'll check if any field value is non-null and also match value length with field lenght , then update it with the new value.

In case of udatation it'll show dialog box updated successfully. Here I dont need to refresh the data from database as it shows one record at a time thats directly coming from database.

Another thing is un-booking that I think can be done by just sending empty value not null with the (almost) existing code, no need of new method for cancel booking. but on the other hand its not required so extra headache.

Thanks in Advance
Best Regards!
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tahir,

Regarding the booking procedure I suppose that is a bit over complicated than it is expected. You have mentioned that once the book menu is pressed then a new panel is displayed with the record's data. I don't see the point of adding extra effort to do this since all of your information is allready displayed on the JTable that you must have on your application. Furthermore the user is expected to remember the records' id to select a Hotel from the combobox. In my approach the booking can be performed on the JTable. On the returned result set there is a button to book a record for a customer. Once it is pressed it checks if other clients are holding locks and if not it displays a simple dialog box that expects the customer's id in order to complete the booking.

Regarding the String[] data I have chosen to work with custom objects. To be more specific I have created a Hotel object that maps to the db schema rather than expecting from junior developers to know on each index of the array what kind of data it will hold.

As far as ti concerns the un-booking it is not mentioned in the instructions and no extra-points will be given. I have thought of implementing it too but I came across several issues and why it cannot be implemented with the currect db schema. What I did is that I have mentioned it to my choices.txt and how it could have been implemented if we had different db schema.

Are we home yet? Wait, did we forget the tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic