You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Kristian Köhler <Kr...@dmc.de> on 2007/09/26 12:20:59 UTC

How to register a Datasource in GlobalJNDI Namespace?

Hi

i use a custom deployment mechanism to install my application into Geronimo 2.0.1. I have no special deployment plan for that kind of application. One component out of my application wants to access the DataSource registered within Geronimo Application server. The component tries to lookup the db via a JNDI lookup call.

My idea is to register the DB within the Global JNDI Namespace and that access it from within my application. I configured the pool via deployment plan and registered a GBeanBinding GBean for the registration in the Global Namespace.

My problem is: What's the name of the DBPool to access/ to link to with the GBeanBinding? Is this a passable way to do this?

Here is the plan:

----- 8< -----

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-${geronimoSchemaVersion}">

    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                <connectiondefinition-instance>
                 <name>Datasource</name>
                  ...
                </connectiondefinition-instance>
            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>

    <gbean name="MyDatabaseBinding" class="org.apache.geronimo.gjndi.binding.GBeanBinding">
        <attribute name="name">Database</attribute>
        <attribute name="abstractNameQuery">?name=Datasource</attribute>
        <reference name="Context">
            <name>JavaContext</name>
        </reference>
    </gbean>

----- 8< -----


Thanks!

Kristian

AW: How to register a Datasource in GlobalJNDI Namespace?

Posted by Kristian Köhler <Kr...@dmc.de>.
sorry wrong list... ;-)

> -----Ursprüngliche Nachricht-----
> Von: Kristian Köhler [mailto:Kristian.Koehler@dmc.de]
> Gesendet: Mittwoch, 26. September 2007 12:21
> An: Geronmio-Dev (E-Mail)
> Betreff: How to register a Datasource in GlobalJNDI Namespace?
> 
> 
> Hi
> 
> i use a custom deployment mechanism to install my application 
> into Geronimo 2.0.1. I have no special deployment plan for 
> that kind of application. One component out of my application 
> wants to access the DataSource registered within Geronimo 
> Application server. The component tries to lookup the db via 
> a JNDI lookup call.
> 
> My idea is to register the DB within the Global JNDI 
> Namespace and that access it from within my application. I 
> configured the pool via deployment plan and registered a 
> GBeanBinding GBean for the registration in the Global Namespace.
> 
> My problem is: What's the name of the DBPool to access/ to 
> link to with the GBeanBinding? Is this a passable way to do this?
> 
> Here is the plan:
> 
> ----- 8< -----
> 
> <connector 
> xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-${gero
> nimoSchemaVersion}">
> 
>     <resourceadapter>
>         <outbound-resourceadapter>
>             <connection-definition>
>                 
> <connectionfactory-interface>javax.sql.DataSource</connectionf
> actory-interface>
>                 <connectiondefinition-instance>
>                  <name>Datasource</name>
>                   ...
>                 </connectiondefinition-instance>
>             </connection-definition>
>         </outbound-resourceadapter>
>     </resourceadapter>
> 
>     <gbean name="MyDatabaseBinding" 
> class="org.apache.geronimo.gjndi.binding.GBeanBinding">
>         <attribute name="name">Database</attribute>
>         <attribute 
> name="abstractNameQuery">?name=Datasource</attribute>
>         <reference name="Context">
>             <name>JavaContext</name>
>         </reference>
>     </gbean>
> 
> ----- 8< -----
> 
> 
> Thanks!
> 
> Kristian
>