You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by RAYMOND Romain <ro...@c-s.fr> on 2002/03/08 09:56:46 UTC

RealmJDBC question

Hello,

I would like to implement RealmJDBC to get userrole from my DB,
but I have to find the role (and so the associated table's row) from
foreign keys
depending on others parameters than user login row ...

is it clear, and anybody has links or docs about this ?

thanks

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: RealmJDBC question

Posted by RAYMOND Romain <ro...@c-s.fr>.
yeah thanks it is a good idea which is an ideal solution for my
application

Christian Froehler a écrit :
> 
> RAYMOND Romain wrote:
> > Hello,
> >
> > I would like to implement RealmJDBC to get userrole from my DB,
> > but I have to find the role (and so the associated table's row) from
> > foreign keys
> > depending on others parameters than user login row ...
> >
> > is it clear, and anybody has links or docs about this ?
> >
> > thanks
> 
> Just another suggestion:
> 
> If your RDBMS supports it, you could use a view. For example, in
> postgresql this should work:
> 
> CREATE VIEW jdbcrealm_user_role
> AS SELECT user_login, role_name
> FROM t_user, t_role, t_user_role
> WHERE t_user.user_id = t_user_role.user_id
> AND t_role_role_id = t_role.role_id;
> 
> This view delivers a simplified view of a more complex user/role
> database structure to jdbcrealm.
> 
> You have to grant the select right to the rdbms-user tomcat uses.
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: RealmJDBC question

Posted by Christian Froehler <Ch...@epost.de>.
RAYMOND Romain wrote:
> Hello,
> 
> I would like to implement RealmJDBC to get userrole from my DB,
> but I have to find the role (and so the associated table's row) from
> foreign keys
> depending on others parameters than user login row ...
> 
> is it clear, and anybody has links or docs about this ?
> 
> thanks

Just another suggestion:

If your RDBMS supports it, you could use a view. For example, in 
postgresql this should work:

CREATE VIEW jdbcrealm_user_role
AS SELECT user_login, role_name
FROM t_user, t_role, t_user_role
WHERE t_user.user_id = t_user_role.user_id
AND t_role_role_id = t_role.role_id;

This view delivers a simplified view of a more complex user/role 
database structure to jdbcrealm.

You have to grant the select right to the rdbms-user tomcat uses.



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>