File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes case sensitive sql statement for  username and password 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 "case sensitive sql statement for  username and password " Watch "case sensitive sql statement for  username and password " New topic
Author

case sensitive sql statement for username and password

Alex Hank
Greenhorn

Joined: Apr 27, 2005
Posts: 16
I want a case sensitive sql statement to control the logins to my website.

I currently use the following statement, however, it does not match case.

SELECT userid,username,firstname, lastname, email, usertype, securelevel, upload, download FROM useraccount WHERE username='"+request.getParameter("id")+"' and password='"+request.getParameter("password")+"'"

Alex
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It is a setting on the database during installation if I remember correctly. If you set it, it effects everything on the box. Someone correct me if I am wrong.

Eric
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30762
    
156

Eric is correct in that case sensitivity definitely depends on the database. Many, like Oracle, are case sensitive by default. Which database are you using?

I don't know of any db setting that leaks through to the OS. However in this case, it is the SQL/db that is requiring the case sensitivity anyway.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: case sensitive sql statement for username and password