Hello all, I'm doing B&S assignment, and have the following interface:
and
Maybe i'm missing something, but findByCriteria() returns a list of record numbers, which i can't return to the client, so i guess i'll have to do a readRecord() of all the records using that long[], but i've just physically read all of them to do the findByCriteria()! Seems like a waste. What am i missing?
The readRecord(long recNo) method will come handy if a client knows which record to display. I use this method in delete and update. If a client attempt to delete record n, the client can display record n before deleting it, this way it ensures no records will be deleted by mistake.
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Anthony Watson
Ranch Hand
Joined: Sep 25, 2003
Posts: 327
posted
0
You could call readRecord in findByCriteria to get a record's data to compare to the criteria array.
Anthony, Thanx for the reply, i was thinking the same thing, but i don't know the exact record count, but i guess i could call read with an ever increasing number until i get EOF..
Hans Nemarich
Greenhorn
Joined: Jun 10, 2004
Posts: 1
posted
0
ED, you can try something like this to know how many records are: