This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30392
    
150

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