This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: loading from database when application start
 
Similar Threads
get a reference to EJBObject from ejbCreate() of SLSB
CreateException: Initial beans in free pool
Valid operation in ejbCreate for stateless session bean
public int ejbCreate() throws javax.ejb.CreateException
ejb life cycle