• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

the search criteria

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Could someone kindly explain to what degree should we take care of the search, such as
"DEST=XXX, Carrier='XXX'", and which fields should be allowed to use in the search ( I believe we have flight no, dest, org, price, day, flight time, etc.)
Thanks
 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am planning to provide search in two modes.
A textfield that'll take the key --- in my beta exam it'll be the subcontractor name. Alternately the user can fill the textfield with any value and choose from a combo box that contains the field names to match from. In that case partial and noncase-sensitive search will be performed.
This is because they wanted a flexible search mechanism.
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


and which fields should be allowed to use in the search


Think of an implementation that does not need to know the "allowed fields" in advance. Rather, it will validate the field names in the criteria at run time, using the database itself.
Eugene.
 
Allen Chan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THanks. Well, that is what I did exactly, I stringTokenize the search criteria string, and parse the criteria value pair, question is
1. how to write the boolean comparison?
right now I hardcoded Values[0] coresponded to flight no, values[1] to org, but I think that is not acceptable,since db format might change in the future.
2. In the requirement it says
** the user should be able to select the origin and destination of the flight, to describe enter the string value any for the origin, destination, or both, so as to implement a wildcard like feature***
can I just put two combobox and satisfied this requirement?
Thanks.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


1. how to write the boolean comparison?
right now I hardcoded Values[0] coresponded to flight no, values[1] to org, but I think that is not acceptable,since db format might change in the future.


Think of a flexibile solution that will not require your code to change even if the database schema changes. All you need to do is get the index of a field that you are searhcing for.


2. In the requirement it says
** the user should be able to select the origin and destination of the flight, to describe enter the string value any for the origin, destination, or both, so as to implement a wildcard like feature***
can I just put two combobox and satisfied this requirement?


Yeah, that will do it.
Eugene.
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic