This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
In my criteria find it works find but I must say in my instructions the string is "Carrier='SpeedyAir',Origin='SFO'" but what I do is populate my comboBoxes origin and destination with all origin and destination not allowing duplicates. In my CriteriaFind I pass a string such as below: String criteria = new String(origin+","+destination); although its not the same but it works find I use the StringTokenizer an it works find but I dont have = as others have talked about "Carrier='SpeedyAir',Origin='SFO'" Suns Example "origin+","+destination" my example I dont search airlines specifically just origin and destination... Is this OK?? Thanks Lisa
Debajyoti Pathak
Ranch Hand
Joined: Dec 18, 2000
Posts: 39
posted
0
Lisa, the specification mentions the format in which you have to pass the query string to criteriaFind method. Why would you want to change that ? Your approach may work but in my opinion you should not change the format of the query string unless you have a very good reason to do so. Deb
Lisa Foster
Ranch Hand
Joined: Feb 28, 2001
Posts: 116
posted
0
I can appreciate that, should I hardcode the fields in then parse it with the String Tokenizer class???
Such as "Origin='FRA',Destination='SFO'" Thanks Lisa
Rudy Yeung
Ranch Hand
Joined: Dec 27, 2000
Posts: 183
posted
0
Lisa, In your criteriaFind() method, you can use two StringTokenizer to break down the criteria into a whole bunch of key/value pair like Origin/SFO. You can then store those pairs in a vector or arraylist, and then pass it to your find() method for a linear search. Rudy
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.