Hi all, Actually I posted this in a different thread, but thought it is not relevant to that and so starting as the new thread(Am gonna delete it there). I am having difficulty in understanding the reason for the existence of findByCriteria() method. Instructions given by the Sun are as follows. It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user. This is the instruction in "The User Interface" section. As there is "or" in the requirement, we can just provide search for the name/location fields and not all the fields. Here they have mentioned strictly by specifying "must" and so we must exactly match like George and others said, case sensitive too. And again, the findByCriteria() is given by // Returns an array of record numbers that match the specified // criteria. Field n in the database file is described by // criteria[n]. A null value in criteria[n] matches any field // value. A non-null value in criteria[n] matches any field // value that begins with criteria[n]. (For example, "Fred" // matches "Fred" or "Freddy".) public long findByCriteria(String criteria); Is this the function we are supposed to implement to get the search results for the requiement mentioned in "The User Interface" section? If so, there is some deviation right? I mean, this function should return like say for Fred, anything that starts with Fred like Fredo, Freddy. Or are we supposed to implement the search requirement for the "The User Interface" section in a different funtion? If so, I do not see the need for findByCriteria() method. Please correct me if I'm wrong. Appreciate your help, thanks.
Thanks Phil. I have gone through the threads once, but could'nt understand them. I will go through them for a couple of more times (or more) and if I still have any doubts, I will post it there as it will be more appropriate there. Appreciate your help. Thanks.
Joined: Aug 12, 2003
Phil, I got it now. Thanks.
subject: NX: URLYBird - Use of findByCriteria(String [ ])?