Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to configure JNDI Datasource in Tomcat 7

 
Prasanna Raman
Ranch Hand
Posts: 398
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the below errors when I run my servlet from Eclipse:


Here is the part I have included in my context.xml inside the Servers folder:



XE is the name of my database
Username: test
Password: test

Below are the init and doGet methods from my Servlet:




I have tested connecting using SQLDeveloper and also using normal JDBC; it connected without any problems. Please help.
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you are following what is said here? (have you updated web.xml, have you tried using context instead of resource)?
Also, is your database running locally. If yes, can you try using localhost instead of IP?
Are the port numbers, database name, userid, password correct and has got enough privileges? (remember case-sensitivity)
Do post back, if you are still getting this issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic