• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to connect mysql database with struts application through jndi

 
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Posted in wrong forum. Moving thread.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Satchidananda Mohanty
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Sagar,
I am going through that..
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's certainly not a Struts question. Moving to Tomcat for now.
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic