Weblogic deployment descriptor datasource question

J

Jeff Kelm

Hi,

Given the following config.xml and weblogic-ejb-jar.xml snippets, what value
should I replace the XXX with in the <res-ref-name> tag in
weblogic-ejb-jar.xml? I assumed that it would be
NHL_Pool_JDBC_Connection_Pool (the name of the connection pool), but that
isn't it.

Help please!

CONFIG.XML:

<JDBCTxDataSource JNDIName="nhlpooltxdatasource"
Name="NHL Pool JDBC Tx Data Source"
PoolName="NHL_Pool_JDBC_Connection_Pool"/>
<JDBCConnectionPool DriverName="weblogic.jdbc.oci.xa.XADataSource"
Name="NHL_Pool_JDBC_Connection_Pool"
Password="{3DES}uM/uBjNraT0="
Properties="user=JEFF_EDIT;server=db3" Targets="hockeyserver"/>

WEBLOGIC-EJB-JAR.XML:

<weblogic-enterprise-bean>
<ejb-name>NHLTeamsEJB</ejb-name>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/XXX</res-ref-name>
<jndi-name>nhlpooltxdatasource</jndi-name>
</resource-description>
</reference-descriptor>
<jndi-name>NHLTeamsEJB_JNDI</jndi-name>
<local-jndi-name>NHLTeamsEJB_JNDI_LOCAL</local-jndi-name>
</weblogic-enterprise-bean>
 
J

Jeff Kelm

I'll answer my own question: the way I had originally written it was
correct; the problem was that I hadn't set the target of the Tx data source.
Oops!

So to set up a data source/connection pool:
CONFIG.XML:

<JDBCTxDataSource JNDIName="nhlpooltxdatasource"
Name="NHL Pool JDBC Tx Data Source"
PoolName="NHL_Pool_JDBC_Connection_Pool"/>
<JDBCConnectionPool DriverName="weblogic.jdbc.oci.xa.XADataSource"
Name="NHL_Pool_JDBC_Connection_Pool"
Password="{3DES}uM/uBjNraT0="
Properties="user=JEFF_EDIT;server=db3" Targets="hockeyserver"/>

WEBLOGIC-EJB-JAR.XML:

<weblogic-enterprise-bean>
<ejb-name>NHLTeamsEJB</ejb-name>
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/NHL_Pool_JDBC_Connection_Pool</res-ref-name>
<jndi-name>nhlpooltxdatasource</jndi-name>
</resource-description>
</reference-descriptor>
<jndi-name>NHLTeamsEJB_JNDI</jndi-name>
<local-jndi-name>NHLTeamsEJB_JNDI_LOCAL</local-jndi-name>
</weblogic-enterprise-bean>

ACCESS DATASOURCE THROUGH AN EJB:
DataSource dataSource = (DataSource)(new
InitialContext()).lookup("java:comp/env/jdbc/NHL_Pool_JDBC_Connection_Pool")
;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top