aspose file tools*
The moose likes JDBC and the fly likes error in comparing data in database with user entered data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "error in comparing data in database with user entered data" Watch "error in comparing data in database with user entered data" New topic
Author

error in comparing data in database with user entered data

hemapriya rao
Greenhorn

Joined: Jun 27, 2007
Posts: 15
I am trying to compare data in database with user entered data,
even though both the values are same its showing me they are not equal..
and I also noticed one more thing ,my strings length in database is 2 more that the original length, [ database value= panda then length should be 5 , but its showing me as 7]



Please could some one help me out..
[ October 03, 2007: Message edited by: hemapriya rao ]
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
Have you checked to make sure there isn't any whitespace in the value stored in the DB? Try using a trim() while comparing.
hemapriya rao
Greenhorn

Joined: Jun 27, 2007
Posts: 15
Thanks Tarun its working now
 
 
subject: error in comparing data in database with user entered data