tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: JDBC Realm with case insensitive user name
Date Thu, 25 Oct 2007 21:30:23 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pedro,

Pedro wrote:
> I basically need to implement case insensitive user names, can this be
> done with a servlet filter or do I need to subclass JDBC realm:

Er, before you get too far on this, check to see if your database
already does this without you realizing that it does.

For instance, MySQL does case-insensitive VARCHAR and CHAR lookups
unless the column type is marked BINARY or you cast the type to BINARY
in your SQL query.

For instance, 'chris' = 'CHRIS' in MySQL inder normal circumstances.

Primary and unique keys respect this behavior, too, so I can't have
"chris" and "CHRIS" as two separate usernames in my user table where
"username" is a UNIQUE key.

You might be able to save yourself a lot of trouble.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHIQru9CaO5/Lv0PARAkV6AJ9eBvJFTb8HCA5lL/6iU17AVF4DyQCgoDWg
TA5RHoInDsnxkDSqILJiYvI=
=J3qJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message