• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can String[] data contain recNo?

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic