Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

How to connect mysql database with struts application through jndi

 
Ranch Hand
Posts: 78
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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: 70384
283
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
It's certainly not a Struts question. Moving to Tomcat for now.
 
I am displeased. You are no longer allowed to read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic