GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes loading from database when application start 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 "loading from database when application start" Watch "loading from database when application start" New topic
Author

loading from database when application start

rudra tripathy
Greenhorn

Joined: May 26, 2004
Posts: 25
hello all,
i want to retrive data and put it into in memory.
i am defined a method for it.
i am using ejbcreate() of stateless session bean.
can i call the method directly from ejbcreate()
Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
Hi,
You have not mentioned anything about your server. Any way you can access the database directly from ejbCreate() but it is STRONGLY RECOMMENDED that you don't do so.
Make a helper class which has a function defined that accesses the database and returns result to your ejbCreate(). Call this function from your ejbCreate().
If you have any doubt, please tell me.
Abhishek
 
GeeCON Prague 2014
 
subject: loading from database when application start