File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes WSAD and Connection Pools Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "WSAD and Connection Pools" Watch "WSAD and Connection Pools" New topic
Author

WSAD and Connection Pools

Matthew Comer
Ranch Hand

Joined: Aug 10, 2001
Posts: 37
If I declare a resource ref in my EJB project, how do I connect a real datasource to the resource ref for the test environment?
I am looking up my datasource in my bean with java:comp/env/jdbc/MyDataSource.
I have declared a resource ref in ejb-jar.xml.
I have the datasource defined on the server config, but under it's "real" JNDI name, i.e. jdbc/MyDataSource.
So, my understanding is that during deployment (if this were to a real server) you would need to connect the resource ref from the ejb-jar to some real datasource on the server.
WHERE IS THIS DONE WITHIN WSAD?
Matt
Matthew Comer
Ranch Hand

Joined: Aug 10, 2001
Posts: 37
Earth to anyone? Come in? Help?
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
This goes (I believe) in the file ibm-ejb-bnd.xml in your EJB-JAR's META-INF directory. I may not be exactly right on the file name but it's pretty close to that.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
OK, I just did this and verified my knowledge. Here's how it works. First of all I'm assuming that you've added the resource reference to the EJb-JAR.xml file using the EJB editor. Next, Pick your EJB and use the menu option to open it in the EJB Extension Editor. Move to the bindings tab of the extensions editor and pick your EJB. Then you can set the JNDI name of the corresponding resource refernece to be the name of the corresponding DataSource in the Server configuration file.
Kyle
Matthew Comer
Ranch Hand

Joined: Aug 10, 2001
Posts: 37
Sweet. I'll be giving that a try shortly.
Thanks for the help.
Matt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WSAD and Connection Pools