On Wed, 12 Mar 2008 13:39:33 -0500
Charles Bacon <[EMAIL PROTECTED]> wrote:

> On Mar 12, 2008, at 11:31 AM, Lasantha Ranaweera wrote:
> 
> > Charles,
> >
> > Thanks for the prompt reply.
> >
> > I just want to access data store in a database via a Globus  
> > service. In JDBC we can get Connections via DataSource object after  
> > configuring it side of server. I want to know whether we can  
> > configure such DataSource inside of Globus container or not.
> 
> I think so.  If you want to see how RFT does it, the source code is  
> online at http://viewcvs.globus.org/viewcvs.cgi/ws-transfer/reliable/ 
> service/java/source/src/org/globus/transfer/reliable/service/database/ 
> RFTDatabaseSetup.java? 
> revision=1.12.4.5&view=markup&pathrev=globus_4_0_branch
> 
> I don't see that it sets up a DataSource, but it does use JDBC.  The  
> connection strings and such are stored in the JNDI config files.

There are examples of DataSource setup and use in the Workspace Service, here
is one:

http://viewcvs.globus.org/viewcvs.cgi/workspace/vm/service/service/java/source/src/org/globus/workspace/accounting/impls/dbdefault/DBAccountingPersistence.java?revision=1.2&view=markup

In that class a JNDI lookup string of the DataSource is passed in via
initialize, how to find which DataSource to use is arbitrary (this parameter
happens to itself ultimately come from a JNDI configuration of another object).

JNDI config file:

http://viewcvs.globus.org/viewcvs.cgi/workspace/vm/service/service/java/source/deploy-jndi-config.xml?revision=1.20&view=markup

In that file there are a few JNDI resources constructed via dbcp
"BasicDataSourceFactory" factory.  That's where the datasources are
configured.  There are also examples of dbLocation JNDI lookup strings in there
(i.e. telling non-DataSource objects how to find the DataSource they should use
via JNDI) 

Tim

Reply via email to