This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes How can I search from different field type ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "How can I search from different field type ?" Watch "How can I search from different field type ?" New topic
Author

How can I search from different field type ?

Narue Klo
Greenhorn

Joined: Apr 03, 2009
Posts: 10


ref is String
receiveno is integer

I would to search from table Receive by searching from ref and receive
I got an error



How can I search from different field type ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63349
    
  70

"Bomber Man", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63349
    
  70

If receiveno is an integer, why are you feeding it a string?
Narue Klo
Greenhorn

Joined: Apr 03, 2009
Posts: 10
Already changed a display name, thanks

I would like to search in condition on both of these two field
How can I do that ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17276
    
    6

What if you do the cast yourself first? Then pass it to the object array in the find method call.

Mark


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can I search from different field type ?
 
It's not a secret anymore!