tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dalecki, Janusz" <jdale...@tycoint.com>
Subject RE: Configured JDBCRealm
Date Wed, 03 Sep 2014 02:31:45 GMT


-----Original Message-----
From: Mark Eggers [mailto:its_toasted@yahoo.com.INVALID]
Sent: Wednesday, 3 September 2014 1:21 AM
To: Tomcat Users List
Subject: Re: Configured JDBCRealm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 9/2/2014 5:04 AM, Daniel Mikusa wrote:
> On Tue, Sep 2, 2014 at 7:00 AM, Dalecki, Janusz <jdalecki@tycoint.com>
> wrote:
>
>> Hi, I have configured JDBCRealm Tomcat with the following:
>>
>> <Context>
>>
>> <Realm className="org.apache.catalina.realm.JDBCRealm"
>> driverName="org.postgresql.Driver"
>> connectionURL="jdbc:postgresql://localhost:5432/df_Scheduler?user=postgres&amp;password=admin"
>>
>>
userTable="users" userNameCol="userName" userCredCol="password"
>> userRoleTable="user_roles" roleNameCol="roleName"/>
>>
>> </Context> I have a few questions:
>>
>> 1)      How can I get hold of this realm object within my  Java
>> app? 2)      Even if I get the instance of the JDBCRealm - how do
>> I get the list of all roles available?
>>
>
> What's the purpose of doing this?
>
> This is just me, but if I wanted to get a list of my users or roles, I
> would use JDBC and pull them from the database.  Then I don't have to
> tie my application to Tomcat's internal classes.
>
> Dan
>
>
>
>> Regards, Janusz

Janusz,

If you want internal access to your users and roles, might I suggest the DataSource Realm?
It has the advantage of using JNDI and a JDBC datasource, so it uses a pool of database connections.
This will perform better as your application load increases.

You'll also be able to use normal JNDI access to query your database for the users and roles.

. . . . just my two cents
/mde/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (MingW32)

iQEcBAEBAgAGBQJUBeBVAAoJEEFGbsYNeTwtPG8H/3s4U7+62S4oJ2+OIDe2Scpe
QOrgv1jM8kSsqkd/My97aaqyIOrLyIc2hmywRzSzw7O+gYfSCItuFn1GHaKC/6JH
XvN9troPcWfnHhIJvuJfn+JykmyOfo0ie17loPsqrwkusrgAuD9/uVNFvJVtPHuI
6tXSuVpKt48No7655X/x/FbtyNHMdZlyd4XIluvM5LmMOkobGgiqg7MKJG6MKATY
FeYr00uZUj3vaEBnkEpZKfJQUuLL89WQH6SxpSNUUI2MwVml5R8TfkiNMkQf1LWy
qvg5v2lq+vTcOnjrEMBH/OR3hP0H3MydONgO/mmLHsmNydYaWc/2P6KcKzd1R10=
=QaV2
-----END PGP SIGNATURE-----

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

Hi,
I have just started reading on DataSource realm.
But I think I am facing the same problem as with JDBCRealm:
1)      How can I get hold of an instance of this DataSourceRealm  object within my  Java
app?
2)      How do I get the list of all roles available?

Regards,
Janusz

________________________________

This e-mail contains privileged and confidential information intended for the use of the addressees
named above. If you are not the intended recipient of this e-mail, you are hereby notified
that you must not disseminate, copy or take any action in respect of any information contained
in it. If you have received this e-mail in error, please notify the sender immediately by
e-mail and immediately destroy this e-mail and its attachments.
Mime
View raw message