• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird DBMain's create delete update method?

 
jin Young
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,ranches.
I get the assinment of URLyBird today, and start the assignment part.

I read the DBMain interface, and confuse the methods in the subject that is create delete update.
According to the instruction CSRs just sells the rooms. So I thought they can only book the room for customers, and CAN NOT create or delete a room from the database(db file).?
Also, when i book a room how to locate which record. by a recordNo generated by the seqence of the record in the db file?

any reply would be appreciate.
Thanks in advance!
 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most people use the location in the file to get the record number. If you have already read your data file in code, you should have some idea what is in there. Another suggestion would be to get a hex editor so you can view the contents of the file, especially if you have not started parsing the file with code. I wrote a class that just reads the file and printed out all the records to the console. There are some good examples of how to do this on this forum. When I was ready to deal with recNo, I wrote a little algorithm so my record numbers would start with 1 and not 0. There are also some good posts on this subject, too. Use the Search function, it will be your best friend!
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And just to complement what Anne Crace said, you must implement both create and delete methods as well. Your delete method should also check if a particular record is locked for a client before deleting it. You won't offer these functions in your GUI, just the update method (that will be called when a customer books a room, and you'll only update the customer id field), but they must be implemented as well.
 
jin Young
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Anne and Roberto , thanks for your kindly reply!

As your words, i can conclude that the create and delete method would be used at the application, just implement the method and leave them not be invoked at all)?

Thanks!
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's it!
 
jin Young
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Roberto,

so thanks for this reply!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic