geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Datasource lookup at Connector Module
Date Wed, 29 Mar 2006 22:16:59 GMT

On Mar 28, 2006, at 2:41 PM, akiramoto wrote:

>
> I have a J2EE application that has a Connector Module, and it has  
> to lookup a
> DataSource configured at Geronimo. Using WebSphere Application  
> Server 6.0,
> it is very simple, because the only thing that I have to do is to  
> use the
> Context.lookup (for example. context.lookup("jdbc/MyDS") ). But  
> this lookup
> doesn't work at Geronimo, and all the articles that I found show  
> examples
> using resource references at Web Applications and EJB Applications.
>
> Where do I have to configure the references to the datasources at my
> Connector module? Should I do anything in particular?

I'm not sure I understand exactly what you are trying to do.  You  
seem to be stating that you have a resource adapter that uses jndi to  
look up a datasource.    If this is what you mean, you are relying on  
non-j2ee features: there are no provisions for jndi access from a  
resource adapter.  However, if you declare a resource-ref to the  
datasource in every j2ee module that uses the connector, I think you  
will still be able to look up the datasource in the connector under  
the java:comp/env/jdbc/MyDS type name.

Otherwise...

You have to follow the j2ee specification and declare all your  
datasources as resource-refs in the appropriate j2ee module.  If the  
datasource is deployed as a connector in the same ear file, geronimo  
will find it as long as the connection-factory-name in the geronimo  
plan is the same as the resource-ref-name.  This will also work (in  
1.0)  if the connector is deployed as a standalone j2ee module (not  
in an ear)  (the rules for 1.1 will be slightly different).  If you  
name the connection-factory differently or put it in a separate ear,  
you need to provide more configuration and you should probably read  
about it in Aaron's book  http://www.chariotsolutions.com/geronimo/ 
geronimo-html-toc.html

hope this helps, please explain what you are doing in more detail if  
you still have problems.

thanks
david jencks

>
> Thanks in advance,
>
> --
> View this message in context: http://www.nabble.com/Datasource- 
> lookup-at-Connector-Module-t1357708.html#a3636478
> Sent from the Apache Geronimo - Users forum at Nabble.com.
>


Mime
View raw message