geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viet Nguyen" <>
Subject Re: Question about a sample Application
Date Tue, 30 Oct 2007 03:34:21 GMT
On 10/29/07, <> wrote:
> Hi , we are working on the geronimo one project. We were looking at a
> sample application that connects to the database in geronimo . Upone
> studying it we stumbled upon a syntax that has a little confused
> In your for the inventory application we found this line of
> code.
> DataSource ds =
> (DataSource)context.lookup("java:comp/env/jdbc/InventoryDS");

The parameter represents the JNDI name of a datasource. Once you deploy the
application, go to the Administration Console, then click on "JNDI Viewer"
on the left panel. It will show you a tree of the JNDI names.

We know what the function does . We just don't know what the parameter
> represents. Which part of the parameter represents the database we are
> connecting to? We need to know the nature of the parameter so that we can
> use it in our own application.

The parameter does not specify which DB you are connecting to. What it does,
is specify which DataSource you wish to use. The DataSource will specify
which DB to connect to. So it's

YourApp --> DataSource --> Database

The DataSource is defined by 'InventoryPool.xml.'

Hope this helps,

View raw message