Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSAD and Connection Pools

 
Matthew Comer
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Earth to anyone? Come in? Help?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sweet. I'll be giving that a try shortly.
Thanks for the help.
Matt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic