Hi!
Bill Pfeiffer wrote:
> What is the proper URI (URL?) form to get a DataSource object from the jBoss
> context? The following code gives me this exception:
> javax.naming.NameNotFoundException: Oracle not bound:
>
> InitialContext jndiContext = new InitialContext();
> String dbName = "java:comp/env/Oracle";
> DataSource ds = (DataSource) jndiContext.lookup(dbName);
> conn = ds.getConnection();
>
> What is the proper form? I used the name 'Oracle' in setting up the
> jBoss.conf and the .xml deployment files.
* In jboss.conf you specify the global JNDI name.
* In ejb-jar.xml you add a DataSource resource, and specify what name to
use ('Oracle'->use 'java:comp/env/Oracle' to lookup).
* In jboss.xml (through EJX GUI->jBoss XML editing) you specify for each
resource which DataSource resource manager you want to use.
* You then add a JDBC resource manager to jboss.xml whose name is the
same as above, and which points to the global JNDI name specified above.
You will then be able to access your DataSource in your EJB.
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]