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

About criteria??

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'v been confused on search criteria for several days.
I will support two drop down ComboBox to search, one is name and another is location. In the panel there are tow button, "All Discontroom" and "search Discountroom", when the use hit the "search Discountroom" button, then my system will search the date based on the criteria that in the combobox selected by the use. If the use selected the name ComboBox only, then location match any, if selected the location ComboBox only, name match any, if both empty, then return all record in the db.db file, this same as hit "All Discountroom". This design OK?
Now my question is how can define the search criteria in the ComboBox? That is, if there are A, B, C record in the db.db file(e.g. on name field), whether I support "A" "B" "C" criteria in the name ComboBox? Then if there is a record name field is "ABC", will I support "AB" "BC" "ABC" search criteria?! If this, the criteria defination will terrible. How you do?
Help me
Andrew, Vlad, Max, Phil!
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leo,

Now my question is how can define the search criteria in the ComboBox? That is, if there are A, B, C record in the db.db file(e.g. on name field), whether I support "A" "B" "C" criteria in the name ComboBox? Then if there is a record name field is "ABC", will I support "AB" "BC" "ABC" search criteria?! If this, the criteria defination will terrible. How you do?


I would fill in the comboboxes with the distinct values found in the database for the corresponding fields, ordere aplphabetically. Example : if you have as locations 3 x Washington followed by 1 New York and 2 Nashville, your combox content should have thre items, in this order : Nashvile, New York, Washington.
If your client cannot be told by the server when those values change (I suppose that RMI callbacks go far beyond the scope of the assignment - easier to achieve with sockets BTW), don't forget to provide the user with some way to refresh those criteria values.
Best,
Phil.
 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, Philippe.
Now I know how to fill my ComboBox.
But I have another question, how can I implement "a flexible search mechanism" statement? Whether should I support a text field, let the user enter a text(search criteria) to search the special record? But I'v seen many thread talk about this, some people suggest don't use the text field. If so, how I can do?
Thanks, thanks again.
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leo,
In my instructions, it is stated (under "The User Interface") "It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user".
If you have similar instructions, comboboxes should be enough.
Regards,
Phil.
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leo,
Your question seems to be on this bullet point in the instructions:
  • A data access system that provides record locking and a flexible search mechanism

  • So the flexible search mechanism is on the server side not the client side.
    For the client side, I agree with Philippe (no surpises there).
    For the server side, you want the search mechanism to be flexible. So don't hard code which columns you are searching in, don't limit the number of columns that can be searched. That sort of thing.
    Regards, Andrew
     
    Leo Tien
    Ranch Hand
    Posts: 156
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Philippe, thanks Andrew.

    In my instructions, it is stated (under "The User Interface") "It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user".


    Exactly, Phli. But when I compare it with the find() method in the db.db file, I'm in hot water.

    Whether this means if there two records in the db.db file, one's name field value is "Washington" and another is "Washington BC"(e.g. only ), so in my ComboBox will have two items: "Washington" and "Washington BC". When the use select "Washington", then the server side will return these two record all, like Andrew said "For the server side, you want the search mechanism to be flexible."
    Is this idea correct?

    Thanks Phil and Andrew.
     
    Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic