*
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
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Question about criteria string
 
Similar Threads
criteria format in criteriaFind method
criteriaFind method doubt regarding requirement !
criteria Find method
Implement ANY to ANY flight search
I Failed SCJD , Help Me