File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB 2.1 - Database connection for multiple users in Entity Bean (BMP) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 2.1 - Database connection for multiple users in Entity Bean (BMP)" Watch "EJB 2.1 - Database connection for multiple users in Entity Bean (BMP)" New topic
Author

EJB 2.1 - Database connection for multiple users in Entity Bean (BMP)

Mathias Mueller
Greenhorn

Joined: Feb 09, 2011
Posts: 1
Hello,

I have a J2EE web application with session beans invoking entity beans (bmp). My question is: Where is the best place to pass the login credentials for the database connection to the entity bean because the login to the database depends on the user login (which comes from a LDAP server) to the web application? Should I set the login credentials in the entity context or should I pass the login credentials when ejbCreate is called and save this login credentials in the entity bean? The data source comes from a properties file but this is not the problem. I can't configure any xml-files in application servers. It must be vendor independent.

Thanks for your help and best regards.

Mathias
 
GeeCON Prague 2014
 
subject: EJB 2.1 - Database connection for multiple users in Entity Bean (BMP)