aspose file tools*
The moose likes JDBC and the fly likes Using database roles in a J2EE application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Using database roles in a J2EE application" Watch "Using database roles in a J2EE application" New topic
Author

Using database roles in a J2EE application

rivka zam
Greenhorn

Joined: Feb 22, 2005
Posts: 24
We are going to use a connection pool DataSource on the Websphere application server.

DataSource uses standard JDBC properties to connect to the DB.

In our IDS we use DB roles.

I would like to know if there is a way to use DB roles with this connection pool DataSource?

Generally, I would like to know if database roles are still used in a J2EE application (that uses DataSource objects in order to connect to the DB)? Or is there a general trend to stop using DB roles and move to J2EE roles?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

I would say no, they are not used much these days to provide user-level security although there may be people out there who still use them to a large degree. Usually DB roles are too limited in functionality to be used in any great degree so most db systems I have worked on use the same set of username/passwords for all users with the condition that the J2EE server ultimately protects the database server from unauthorized access (assuming the DB server is not exposed externally).


My Blog: Down Home Country Coding with Scott Selikoff
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
If you want to use your DB roles, check to see if your DB exports them via an LDAP or similar implementation. You may be able to wrap a JAAS provider around your DB roles that way.


Reid - SCJP2 (April 2002)
 
Don't get me started about those stupid light bulbs.
 
subject: Using database roles in a J2EE application