Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about criteria string

 
Holmes Wong
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic