• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nx:All of URLy Bird 1.1.3 how to deal with data from database file

 
liqun chang
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:George and Satish
i use below method read the data from the database file:

My question is:in read() of Data i want use these code for access datafile.
Whehter in String[](the return value)must contains the id?also the customer
id must be displayed in the JTable?
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liqun,
Originally posted by liqun chang:


My question is:in read() of Data i want use these code for access datafile.
Whehter in String[](the return value)must contains the id?also the customer
id must be displayed in the JTable?

I see why you are reading the flag first, because it is really not one of the record's fields but rather a flag indicating whether the record has been deleted or not. However, I don't see why you are treating the customer identity as if it were not one of the record's fields. That is, I think you should be reading either all the fields of the record at one time, or you should read each field of the record individually. There doesn't need to be a distinction between the customer identity field and the rest of the fields in the record.
I think the String[] return value absolutely must contain all the fields of the record and that includes the customer id. I also think that the customer id should be displayed in the JTable. I think it is appropriate to display both unbooked and booked records in the JTable.
 
liqun chang
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:George the below statement let me be confused
the instruction say:
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.

i think the 8 digit number is long.so use the raf.readLong()method.
Whether i use raf.read(byte[] record),then convert byte array to string,then to divide string and get all of fields of one record(contain customer identify)?
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liqun,
Originally posted by liqun chang:
i think the 8 digit number is long.so use the raf.readLong()method.
Whether i use raf.read(byte[] record),then convert byte array to string,then to divide string and get all of fields of one record(contain customer identify)?

No, the customer ID is a string value that consists of 8 numeric digits. For example: "12345678".
So the customer ID field can be treated exactly like all the other fields in the record, that is, as a string. Treat the customer ID field as you would any of the other fields: name, location, etc.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liqun
Originally posted by George Marinkovich:
Hi Liqun,
I think the String[] return value absolutely must contain all the fields of the record and that includes the customer id. I also think that the customer id should be displayed in the JTable. I think it is appropriate to display both unbooked and booked records in the JTable.

I totally agree with George. As always he clearly explained. The Customer ID is part of the record and I too think it must be displayed in the JTable.
Good Luck.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic