Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

RecordNotFoundException

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try {
// Determine where in the file this record should be.
// note: if this is null the record does not exist
locationInFile = recordNumbers.get(recNo);
if(locationInFile==0L)
{
throw new RecordNotFoundException("Record not found.");
}

recordNumbers is hashmap where key is recNo and value is offset of record

is it right condition to throw RecordNotFoundException ???

pleset let me know
 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Your implementation seems to be okay. As per my understanding, this exception will be thrown when you provide implementation for

The above method requires the record no and will look up into the map. If the record is not available, RecordNotFoundException will be thrown.

I read your earlier posts couple of weeks ago and found the incorrect implementation of readRecord method. Check your implementation again

sat
 
My cellmate was this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic