[jboss-user] [JNDI/Naming/Network] - How to use JNDI names?
Kentzhou
do-not-reply at jboss.com
Wed Jan 3 14:23:09 EST 2007
The following code is used for finding out a datasource or ejb:
InitialContext ic = new InitialContext();
datasource = (DataSource) ic.lookup(myJNDIName);
Question is:
in JBOSS, it convert ENC name to JNDI name in jboss-web.xml
If my ENC for datasource is java:comp/env/jdbc/myDataSource,
In Web.xml it is jdbc/myDataSource,
in jboss-web.xml it is java:/myDB
Then what should I use for lookup?
myJNDIName should be "java:comp/env/jdbc/myDataSource" or "dbc/myDataSource" or "java:/myDB"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997674#3997674
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997674
More information about the jboss-user
mailing list