This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Question about criteria string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Question about criteria string" Watch "Question about criteria string" New topic
Author

Question about criteria string

Holmes Wong
Ranch Hand

Joined: Feb 18, 2002
Posts: 163
Hi,
In the assignment, there is a example like this for the criteria string:
"Carrier='SpeedyAir', Origin='SFO'"
The trouble is that "Origin" does not comform to
"Origin Airport" in the database.
I am using JComboBox on GUI, it is a good idea to name a JConboBox like "Origin Airport" instead of
"Origin" so that it will be easier to form the criteria string and search the database? OR I just add "Airport" after I get "Origin" later on before my search?
Which one is allowed or better?
Thanks.
Steven Sloggett
Greenhorn

Joined: Feb 11, 2002
Posts: 15
Originally posted by Holmes Wong:
Hi,
In the assignment, there is a example like this for the criteria string:
"Carrier='SpeedyAir', Origin='SFO'"
The trouble is that "Origin" does not comform to
"Origin Airport" in the database.
I am using JComboBox on GUI, it is a good idea to name a JConboBox like "Origin Airport" instead of
"Origin" so that it will be easier to form the criteria string and search the database? OR I just add "Airport" after I get "Origin" later on before my search?
Which one is allowed or better?
Thanks.

Use the actual database field name. Treat the criteria string in the requirements as an example rather than exactly what should be passed in to your 'criteriaFind' method.
So you would have:

That said, even though you pass 'Origin airport' to 'criteriaFind', it doesn't matter what your JComboBox is called.


Steven
 
 
subject: Question about criteria string