You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/07/11 00:56:58 UTC
DO NOT REPLY [Bug 35682] New: -
more flexible JDBCRealm
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35682>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=35682
Summary: more flexible JDBCRealm
Product: Tomcat 5
Version: 5.5.9
Platform: Other
OS/Version: other
Status: NEW
Severity: enhancement
Priority: P2
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: aktweb@msn.com
The JDBCRealm currently is configured via table names and column names. In
our database, this is not flexible enough and we cannot use the JDBCRealm.
The proposed enhancement adds new configuration strings to the JDBCRealm to
allow it to work with more database schemas. Specifically, you specify and
credentialsSQL and rolesSQL configuration string in the Realm fragment in
server.xml.
With this enhancement, my Realm fragment looks like this:
<Realm
className="org.apache.catalina.realm.JDBCRealm"
driverName="net.sourceforge.jtds.jdbc.Driver"
connectionURL="jdbc:jtds:sqlserver://localhost:1433/xxx;SelectMethod=cursor;Use
r=xxx;Password=xxx"
credentialsSQL="SELECT FPassword FROM DAccount
WHERE FUsername=?"
rolesSQL="SELECT DRole.FName FROM DAccount
INNER JOIN DAccountToDRole ON DAccount.FId = DAccountToDRole.FAccountId INNER
JOIN DRole ON DAccountToDRole.FRoleId = DRole.FId WHERE (DAccount.FUsername
= ?)"
/>
The code modifications in JDBCRealm.java are minor, the diff -u will be
attached. Basically, if the credentialsSQL and rolesSQL are valid (ie non
null and not ""), then the credentialsSQL and rolesSQL will be used instead of
any column/table names provided.
-- thanks, Andrew
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org