tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Kurinskas <scott.kurins...@gemstone.com>
Subject DAS & JNDI requirements
Date Tue, 22 Aug 2006 20:26:31 GMT
Hi-
 
I'm trying to create a trivial java app that uses the tuscany data access
service to access a rdb using.  What I cannot figure out is what environment
variable or system property to I need to register?  I've modified
CompanyConfig.xml such that I've specified the dataSource attribute in the
<ConnectionInfo> element as shown below.
 
<ConnectionInfo
dataSource="jdbc:mysql://localhost/test?user=mysql&amp;password=mysql"/>
 
This obviously is not sufficient, but I'm not sure what else I'm missing.
 
Thanks,
Scott
 
DAS das = DAS.FACTORY.createDAS(getConfig("CompanyConfig.xml"));
String sql = "Select * from customers where ID = " + id;
Command readCust = das.createCommand(sql);
//<----------  exception here
 
Exception:
Exception in thread "main" java.lang.RuntimeException:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file:  java.naming.factory.initial
 at
org.apache.tuscany.das.rdb.impl.DASImpl.initializeConnection(DASImpl.java:16
2)
 at org.apache.tuscany.das.rdb.impl.DASImpl.getConnection(DASImpl.java:131)
 at
org.apache.tuscany.das.rdb.impl.DASImpl.baseCreateCommand(DASImpl.java:228)
 at org.apache.tuscany.das.rdb.impl.DASImpl.createCommand(DASImpl.java:197)
 at gemfire.example.rdb.mds.CompanyClient.testRead(CompanyClient.java:66)
 at gemfire.example.rdb.mds.CompanyMain.main(CompanyMain.java:24)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message