Struts-Config Datasource bound in context
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   craig_smith
Posted On:   Friday, February 6, 2004 08:49 PM

I am building my first struts webapp and I am using the datasource in the struts-config file, but I don't see how to bind the datasource in the context. I don't know where to put "jdbc/emtech". I don't want to have to put it in the server.xml. Is there a way to specify it in the struts-config file? ***************************************************** My struts-config.xml file ***************************************************** ***************************************************** Here's the code that's trying to instantiate the connection pool. **************   More>>

I am building my first struts webapp and I am using the datasource in the struts-config file,
but I don't see how to bind the datasource in the context. I don't know where to put "jdbc/emtech". I don't want to have to put it in the server.xml. Is there a way to specify it in the struts-config file?



*****************************************************

My struts-config.xml file

*****************************************************



			














*****************************************************

Here's the code that's trying to instantiate the connection pool.

*****************************************************



DataSource connectionpool;


Context env = (Context)new InitialContext().lookup("java:comp/env");

connectionpool = (DataSource)env.lookup("jdbc/emtech");


******************************************************

Here's the exception that is being thrown

******************************************************

			
javax.naming.NameNotFoundException: Name jdbc:emtech: is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at com.emtech.businesslogic.Factory. (Unknown Source)
at com.emtech.businesslogic.Factory.getFactory(Unknown Source)
   <<Less
About | Sitemap | Contact