• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Question about criteria string

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Acetylsalicylic acid is aspirin. This could be handy too:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic