Two Laptop Bag*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes FBNS: Customer are searching db.db via what? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "FBNS: Customer are searching db.db via what?" Watch "FBNS: Customer are searching db.db via what?" New topic
Author

FBNS: Customer are searching db.db via what?

George Ren
Ranch Hand

Joined: Aug 17, 2002
Posts: 58
Hi everyone,
I recently found there are lots of columns in the db.db file. Such as Flight Number, Origin airport, Destination airport, Carrier so forth.
My question is Which of them does tht customer use to search the Flight? All I should enable the customer to use any of them to search? If that is true, there will be lots of JCombobox and Textboxs, if the customer don't select all of them, that means only use some of the Comboboxes and testboxes, I think I should assembled them together in order to search, I think there will be large ammount of work.
So, I confused whether my analysis is correct?
Pls Guide me.

Regards,
George


THINK!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Hi George,
while the Instructions.html file doesn't exactly spell it out, because there are two areas where it seems that they are mentioning what they can search on. So I took it from both and included; Airline, Arrival Airport, Departure Airport. Not necessarily in that order.
I got to go to a meeting. I'll post again to finish this.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
Hi George,
You can also simply offer a dialog box that allows the user to type in what they want, per the instructions. Then usedregex to sort the String. It's not that hard, really.
M


Java Regular Expressions
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

I'm back.
My final statement is that you should use JComboBox for all three. Do not use JTextField, we have found that you will lose points if you do.
Mark
George Ren
Ranch Hand

Joined: Aug 17, 2002
Posts: 58
Thank u , Mark and Max.
So it that mean the customer only use the Airline, Origin airport and Destination airport to search. I only have to design the three JComboboxes for that?
Or I should be like Max said. It will be up to the customer?

Regards,
George
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
Originally posted by George Ren:
Thank u , Mark and Max.
So it that mean the customer only use the Airline, Origin airport and Destination airport to search. I only have to design the three JComboboxes for that?
Or I should be like Max said. It will be up to the customer?

Regards,
George

Either will work: it's just a matter of writing GUI code or regex code.
George Ren
Ranch Hand

Joined: Aug 17, 2002
Posts: 58
I think I understand. Thanks.
But Max ,could u tell me what the "regex code" mean? I havn't heard it before.

Regards,
George
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11490
    
  95

Hi George,
But Max ,could u tell me what the "regex code" mean? I havn't heard it before.

Max is talking about the server side, where you need to validate that the string passed to criteriaFind is correct, and extract the column names and values to match from the provided String.
Max is suggesting you use regular expressions, (commonly referred to as regex) which you will find in the java.util.regex package.
If you have never used regular expressions before, you may want to look at them. They are extremly powerful. They can also be difficult to master (which is one reason for looking at them now: you have the time to learn new things - in a real job you may not have the luxury of time).
But you don't have to use regular expressions, there are plenty of other ways that also work. Perhaps not as elegant as regex, but certainly valid nonetheless.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Yes George you would only need three JComboboxes.
Mark
George Ren
Ranch Hand

Joined: Aug 17, 2002
Posts: 58
Thank u all. I have finished my GUI file already.
No problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FBNS: Customer are searching db.db via what?