• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

key field in find method

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is the comment of the find method from my Data class. From the body of the method, I can tell it is using the first element of the String array expression of a record, which is the flight number. I am confused about: "For this assignment, the key field is the record number field.". What is this record number field?
Thanks in advance!
/**
* This method searches the database for an entry which has a first
* field which exactly matches the string supplied. If the required
* record cannot be found, this method returns null. For this
* assignment, the key field is the record number field.
*
* @param toMatch The key field value to match upon for
* a successful find.
* @return DataInfo The matching record.
* @exception DatabaseException Thrown when database file could not be accessed.
*/
public synchronized DataInfo find(String toMatch) throws DatabaseException {
...
}
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The find method compares the argument String to the flight number field. This is the character based field in the db.db. Do not confuse this field with the actual record number, which you pass to the locking mechanism.
Mark
 
michael opto
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
mooooooo ..... tiny ad ....
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic