• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can String[] data contain recNo?

 
dennis du
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
--------------------------------------------
// Reads a record from the file. Returns an array where each
// element is a record value.
public String[] read(int recNo) throws RecordNotFoundException;
public void update(int recNo, String[] data, long lockCookie)
---------------------------------------------

I add a recNo to String[] data.So the record has 7 fields.
But the data.length == 8.

Is it ok? I am not sure.

Thanks !!!
 
dennis du
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do think there is problem here.
For the sun maybe will use other client to test my server,
when the data[] he passed to my server is not what I expected.

There may have some error.

Am I rught?
 
Vincent Hernandez
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dennis,

I believe this is something you will need to point out in your choices.txt. From what I've read on these Javaranch forums is that the testers won't assume anything you do, and that you should probably state it. I think whichever choice you make...7 or 8...you should state why you did that and let them know which index corresponds to which field value.


For me, I have 6, because I don't pass the delete flag. I do use the delete flag within my data system, but when it's regarding data retrieval, I don't see the need for it.

I'm sure others will have 7 or 8.

The other thing is I'm not sure which assignment you're doing, so you may have more fields in your database schema, so the numbers will vary.

In summary, just document it!

As for the verification of the values passed in data[], you'll have to make a decision. I have made a decision on how to handle this matter, and it will be different for other people.

Vince
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic