jQuery in Action, 2nd edition
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: URLYBird - Use of findByCriteria(String [ ])? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "NX: URLYBird - Use of findByCriteria(String [ ])?" Watch "NX: URLYBird - Use of findByCriteria(String [ ])?" New topic
Author

NX: URLYBird - Use of findByCriteria(String [ ])?

Satish Avadhanam
Ranch Hand

Joined: Aug 12, 2003
Posts: 697
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.
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Satish,
About the apparent and/or and and exact/partial matches apparent contradictions in searching, I suggest you to read the two threads below (and possibly the links included):
http://www.coderanch.com/t/184550/java-developer-SCJD/certification/NX-Search-Criteria-GUI
http://www.coderanch.com/t/184754/java-developer-SCJD/certification/NX-findByCriteria
Don't hesitate though to go on asking questions in this thread is something looks still unclear after reading.
Regards,
Phil.
Satish Avadhanam
Ranch Hand

Joined: Aug 12, 2003
Posts: 697
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.
Satish Avadhanam
Ranch Hand

Joined: Aug 12, 2003
Posts: 697
Phil, I got it now. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX: URLYBird - Use of findByCriteria(String [ ])?
 
Similar Threads
how to define criteria for search
findByCriteria()
URLyBird findByCriteria
a question about requirement, findByCriteria
Another Question about findByCriteria