wood burning stoves 2.0*
The moose likes JDBC and the fly likes weird issue with Like and Where Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "weird issue with Like and Where " Watch "weird issue with Like and Where " New topic
Author

weird issue with Like and Where

Eman Adenola
Greenhorn

Joined: Apr 03, 2011
Posts: 27
Oh wow..how many threads in one day, eh?
lol..well to the point
I am getting results i think i shouldn't be getting..but i am not sure why I am getting them..so I am here..again

i have a table that has an id and a name

and i have a query like so:


yep I hardcoded when I thought something might be wrong with the variable data..but it didn't matter...
The thing is I have table that has an id of 3 and name Lincoln..but the sql statement picked it up and that doesn't make sense to me.
id=1 is false, however Lincoln has an i in it..
false && true = false...
so what is happening here?
Any ideas?
Thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19682
    
  20

And what name does the record with ID 1 have? Does that name perhaps also have an "i" in it?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Eman Adenola
Greenhorn

Joined: Apr 03, 2011
Posts: 27
Rob Spoor wrote:And what name does the record with ID 1 have? Does that name perhaps also have an "i" in it?

yeah, its name is Lincoln
i fixed the problem..i had to make the variable for the resultset of a database a session in order for it to work and i don't know why.
Making its scope session seems to clean the resultset but for some reason request scope doesn't do that..and I really don't know why
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: weird issue with Like and Where