This content has been marked as final.
Show 3 replies
-
1. Re: Not able to lookup the datasource in jboss
galderz Dec 28, 2005 7:34 PM (in response to jkk)Are you trying to do the lookup from outside JBoss? Home references for session beans can be retrieved remotely via JNDI, however, datasources (*-ds.xml) and in general items bound at "java:" cannot be retrieved remotely (check JCA specification).
Hope this helps :-) -
2. Re: Not able to lookup the datasource in jboss
jkk Dec 28, 2005 11:22 PM (in response to jkk)Can you help me by sending some sample example about how to lookup datasource?
Thanks in advance
Shrimon -
3. Re: Not able to lookup the datasource in jboss
galderz Dec 29, 2005 6:09 PM (in response to jkk)you can find further information about how to configure datasources in the following wiki page:
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources
it includes how to set up a datasource in order to access it remotely.
The following is a sample code on how to do a lookup for a datasource:Context ctx; ctx = new InitialContext(); ConnectionFactory cf = (ConnectionFactory)ctx.lookup(java:/MySQL); Connection c = cf.getConnection();
This is a very generic example, but should give you an idea of the steps required.