This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Help regarding comparison of a string value with a String stored in database 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 » Databases » JDBC
Bookmark "Help regarding comparison of a string value with a String stored in database" Watch "Help regarding comparison of a string value with a String stored in database" New topic
Author

Help regarding comparison of a string value with a String stored in database

shobha devi
Greenhorn

Joined: Mar 11, 2009
Posts: 11
I have a table in oracle that contains a string. I retrieve the value and store it in a string variable. Now when i compare the retrieved value with another string using ".equalsIgnoreCase" the result returned is always false.

Can anybody suggest a method to accomplish my requirement
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


Hello,

I assume that you must have verified that both the String being compared are the same. You might just want to do a .trim() on the objects to remove any leading or trailing whitespace from them before you do an equals() nor an equalsIgnoreCase().

Cheers,
Raj.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help regarding comparison of a string value with a String stored in database
 
Similar Threads
encoding and decoding in java
using dynamic path in FileOutputStream("")
Data Insert Problem
convert String into Object
convert String in to String array ???