Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: about database field problems

 
Along huang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,I take the URLyBird assignment.

this is the third time to read instruction carefully, I find more and more puzzling statements below:

1. interface DBMain.java have a method
public void delete(int recNo) throws RecordNotFoundException;
what is the parameter "recNo"? as you know, in databse file db-1x2.db here have not a field named recNo!

2. in Database schema,I can't fully understand the certain intention of below two fields:

First is "Date available", Sun's description is:
"The single night to which this record relates, format is yyyy/mm/dd"

Whether it express the time which the room is occupied by customer?

Second is "Customer holding this record",Sun's description is:
" The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale"

Whether I can fill with a random 8 digit number?
and I feel this field is useless,as it should not be used in application.
 
Phil Harron
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

what is the parameter "recNo"? as you know, in databse file db-1x2.db here have not a field named recNo!


You will have to create this number in the code and store it as part of each record. It could be an incremental number starting from 0, for instance.

2. in Database schema,I can't fully understand the certain intention of below two fields:
First is "Date available", Sun's description is:
"The single night to which this record relates, format is yyyy/mm/dd"
Whether it express the time which the room is occupied by customer? .[\QUOTE]

It does'nt express the time. I think you can assume (make sure you document it) that the CSR's will know that they cannot put in a date more than 48hrs in the future - maybe you can warn them but let them put a date in anyway.

Second is "Customer holding this record",Sun's description is:
" The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale"

Whether I can fill with a random 8 digit number?
and I feel this field is useless,as it should not be used in application


This is the only way that the CSR's will know that the record is available for booking is it not? If they could'nt identify which customer booked the room then it would ne of no use, and the CSR's would never know if it was available or not. This coupled with the booking date provides enough info for the CSR's to see what's going on.

Why would you want to generate a random number, just let the CSR's put it in. You can validate to make sure its an 8 digit number.

Hope this helps?

[ June 08, 2004: Message edited by: Phil Harron ]
[ June 08, 2004: Message edited by: Phil Harron ]
 
Along huang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!

You will have to create this number in the code and store it as part of each record. It could be an incremental number starting from 0, for instance


The incremental number should be store in database as a part of a record, but the origial db file have not a corresponding field.
for being compatible with the existing data file format, I can't append a new field in the original db file, how should I do?

best regard
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic