wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 30057
    
149

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
 
jQuery in Action, 2nd edition
 
subject: case sensitive sql statement for username and password
 
Similar Threads
Radiobuttons & comboxes in an SQL query
How to make SELECT statement case sensitive?
Where to write Validation
jsp expressions doubt ???
Problem with SQL select