I need to store and use variable in EJB 2.0 like Application level variable in Servlets/Jsps

I am using EJB 2.0 and i want to use variable like global variable, as we use application level or context level variables in Servles/jsp's like that i want to use variable in EJB 2.0. Please suggest is there any configuration in ejb's .xml file for this requirement.

Actually i want to configure Connection Pool Name. And if i configure it as you suggest then it will need code changes if my connection pool change. On the other hand if i configure it in any .xml file like context parameter then i can change it any time only need to restart the server. This is the main reason, Please suggest me any good option. Or if there is way to use connection pool with ejb.

kishukishor patil wrote:Actually i want to configure Connection Pool Name. And if i configure it as you suggest then it will need code changes if my connection pool change. On the other hand if i configure it in any .xml file like context parameter then i can change it any time only need to restart the server. This is the main reason, Please suggest me any good option. Or if there is way to use connection pool with ejb.

Thanks brother...

Almost always you access a connection pool thru a datasource via jndi lookup. The datasource jndi name is specified in EJB XML files.