geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianny Damour <gianny.dam...@optusnet.com.au>
Subject Re: DataSource, JNDI and EJB module ...
Date Mon, 13 Aug 2007 13:48:40 GMT
On 13/08/2007, at 11:33 PM, JohnSimpson wrote:

>
> Hi,
>
> No.  I didn't realise I needed to set it as a dependency as the  
> datasource
> is deployed seperately, I will give it a go.
> Currently, I included the datasource as a resource in the
> geronimo-application-client.xml, like this:
>
>     <naming:resource-ref>
>         <naming:ref-name>jdbc/DataSource</naming:ref-name>
>         <naming:domain>geronimo.server</naming:domain>
>         <naming:server>geronimo</naming:server>
>         <naming:application>null</naming:application>
>         <naming:module>console-db-pool-MDMDB2</naming:module>
>         <naming:type>JCAManagedConnectionFactory</naming:type>
>         <naming:name>MDMDB2</naming:name>
>     </naming:resource-ref>
>
> It's basically a straight cut and past from the usage panel.  I then
> reference it in the application-client.xml, like this:
>
>     <resource-ref>
>       <description>DB2 datasource</description>
>       <res-ref-name>jdbc/DataSource</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>     </resource-ref>
>
>
> So I need to put in a dependency as well?

Yes. You need to declare a dependency. Also, if you are using JEE5,  
you can benefit from the Resource injection annotation:

     @Resource(name="MDMDB2")
     private static DataSource ds;

Thanks,
Gianny


>
> Thanks,
>
> John
>
> -- 
> View this message in context: http://www.nabble.com/DataSource%2C- 
> JNDI-and-EJB-module-...-tf4090122s134.html#a12126274
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Mime
View raw message