Author
How to connect mysql database with struts application through jndi
Satchidananda Mohanty
Ranch Hand
Joined: Mar 12, 2008
Posts: 77
Hi,
Could you say me how to connect the mysql database from a struts application through jndi process.
I have used these steps..
in my action class i have used
after deploying this i got this error
javax.servlet.ServletException : javax.naming.NameNotFoundException : mydatabase not found
SO i have checked with driver file,context.xml file.
I saw this from http://wiki.metawerx.net/wiki/JNDIDBCPExampleForMySQL5.x
If you get a javax.naming.NameNotFoundException error, you have either not installed the context.xml file correctly, or have used a different name in the context.xml <Resource> element's "name" attribute to what you are using in your Context.lookup() call.
I think some more configuration is requird to use the context.xml file..
can anybody help me regarding this..
Thanks in advance..
zeet
Zeet
SCJP 6.0
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
Posted in wrong forum. Moving thread.
Sagar Rohankar
Ranch Hand
Joined: Feb 19, 2008
Posts: 2896
Please refer to this Tomcat docs:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
and edit the web.xml as given there.
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Satchidananda Mohanty
Ranch Hand
Joined: Mar 12, 2008
Posts: 77
Thanks a lot Sagar,
I am going through that..
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Feb 17, 2010 06:19:39
0
It's certainly not a Struts question. Moving to Tomcat for now.
subject: How to connect mysql database with struts application through jndi