Can I add the DataSource resource through the ejx gui or do I have to look
up the spec and edit the ejb-jar.xml directly?  If I have to edit it
directly, what exactly is the XML?  I didn't see a place to add a resource
manager through the gui fo the ejb-jar.xml.

I think I set up the jboss.xml correct:
1. Added a JDBC Resource under the resource manager tab.
2. Resource name: 'Oracle'
3. JNDI-name of datasource: 'java:comp/env/Oracle'

This is kind of confusing.  Can you point me to some docs that explicately
state how to name the connection in the jboss.conf, what the entrys in the
ejb-jar.xml, and jboss.xml are supposed to be for the given connection.

Thanks again,


Bill Pfeiffer
Arbitration Forums, Inc
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Rickard �berg
Sent: Thursday, June 22, 2000 2:04 AM
To: jBoss
Subject: Re: [jBoss-User] URI for jBoss DataSource


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]




--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to