permaculture playing cards*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes criteriaFind Questions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "criteriaFind Questions?" Watch "criteriaFind Questions?" New topic
Author

criteriaFind Questions?

seagullz peizhi
Greenhorn

Joined: Jun 05, 2002
Posts: 13
in criteriaFind() it takes in a String "Carrier='SpeedyAir',Origin='SFO'",and we split them as what we want,but when i compare the field name as the db's field name,you know they arenot exactly same,
like "Orgin" as "Orgin airport",so it's wrong with the method getName(),i want to change the criteriastring as "Carrier='SpeedyAir',Origin airport='SFO'",am i right?
maybe it is a simple question,but any help is precious to me 3ks


i am a beginner ,thank you
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Seagullz,
Yep, the field names have to match. What I did was create an interface called FBNConstants which contained an array of the field names and int constants like ORIGIN, DESTINATION, DURATION, etc.
So I would just build my criteria using those constants, for example SCHEMA[CARRIER] would then be the exact field name for carrier.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
seagullz peizhi
Greenhorn

Joined: Jun 05, 2002
Posts: 13
thank you very much
 
jQuery in Action, 2nd edition
 
subject: criteriaFind Questions?
 
Similar Threads
a small clarification..
Question about criteria string
criteriaFind
getRecord Vs readRecord usage in criteriaFind()
I catch a mistake in the specification