You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joel Baker <ne...@news.jb21.net> on 2002/05/06 04:55:20 UTC

Utilising JDBC Realm config and pooling from a webapp

Hi there,

I've set up a webapp to use a JDBC Realm in my server.xml config file in
Tomcat 4.0.3. I use this for FORMS based authentication.
I have added fields to the SQL table used to authenticate to include more
interesting things like Full Name and email address. I have currently hard
coded the database details (server, db, table, username, password) using
some raw JDBC code in servlets and JSP pages just to see whether the webapp
would function correctly.

I now want to move to a more refined solution with the details specified in
a central location - ie: server.xml, and also to use some sort of JDBC
connection pool. However, these details are of course already specified in
the JDBC Realm and, presumably, Tomcat does some sort of connection pooling
for its Realms. Thus I was wondering whether it would be possible to utilise
both of these for my own use.

I've tried to research this but not found much, other than a possibility
that Realms are read-only - which wouldn't be too useful from my perspective
as I'd like to use the setup to maintain the userlist as well.

Any ideas on this would be greatly appreciated.

If this isn't possible, I will have to maintain two identical sets of db
information in my server.xml, which isn't tragic, but will also have to
investigate connection pooling further. I have written my own connection
pool in the past but would be interested in a more maintained, pluggable,
solution. Any ideas on this would also be welcomed.

Many thanks for any help,

Joel Baker.


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