• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic