On Fri, 7 Feb 2003, Uros Kotnik wrote:
> Date: Fri, 7 Feb 2003 15:58:12 +0100
> From: Uros Kotnik <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: 'Tomcat Users List' <[EMAIL PROTECTED]>
> Subject: DataSourceRealm
>
> I'm using TC 4.1.8
>
> I read a instructions for implementing DataSourceRealm basicaly same as
> JDBCrealm but my tables for users and roles are connected with id
> (number).
>
> Users(id_user, login_name, pass)
> Roles(id_role, role_name)
> Users_Roles (id_user, id_role)
>
> Because of that I can't use TC realm implementation (or I can ?). So is
> it possible just to extend DataSourceRealm class and overload methods
> which construct SQLs and do I have to implement some other methods or
> what ever is possible.
>
Assuming you're not using MySQL (which does not support them), you can
create a VIEW in your database that synthesizes the table structure
DataSourceRealm needs -- something along the lines of:
create view tomcat_users_roles as
select u.login_name, r.role_name
from users u, roles r, users_roles ur
where (ur.id_user = u.id_user) and (ur.id_role = r.id_role);
Then, you can configure Tomcat to use "tomcat_users_roles" that will
appear to have login_name and role_name columns, even though there is no
such physical table in existence.
> Thanx
>
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]