This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes which to follow when the instruction and the DB interface conflict to each other Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "which to follow when the instruction and the DB interface conflict to each other" Watch "which to follow when the instruction and the DB interface conflict to each other" New topic
Author

which to follow when the instruction and the DB interface conflict to each other

Alexandra Zhang
Greenhorn

Joined: Jun 08, 2007
Posts: 16
For the searching part specifications I've got are in two versions in the instruction and the DB interface.

The instruction said:"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."
The DB interface said in comment:"
//A non-null value in criteria[n] matches any field
// value that begins with criteria[n]
. (For example, "Fred"
// matches "Fred" or "Freddy".)"

I guess I should follow the instruction, shouldn't I?
Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Alexandra Zhang wrote:I guess I should follow the instruction, shouldn't I?


Yep . There's lots of info about this topic on the forum.


SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Alexandra Zhang
Greenhorn

Joined: Jun 08, 2007
Posts: 16
Thanks a lot for your quick response.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

I think it's by far the most frequently asked question on this forum.

And the answer is simple: for your Data class implement what's asked (startsWith matching) and then you have to do some extra filtering to only show the exactly matching records.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: which to follow when the instruction and the DB interface conflict to each other
 
Similar Threads
how to define criteria for search
NX: URLyBird1.1.3, about the find method in Data class.
find method from database side in B&S
Do we need to filter the search result data?
URLyBird: What is "exactly match" in URLyBird?