Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat6: no mysql DB connection

 
Michael Oberleitner
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I'm using Tomcat 6 and I need to have mysql-DB access in my application but I'm getting this error message:



This is a part which i changed to establish db access in the server.xml:


The password is correctly set.

This is the META-INF/context.xml file:


and this is the web.xml file:


and this is the code of the StartServlet:


I put the mysql-connector-java-5.1.13-bin.jar in the WEB-INF/lib folder of the application and in the apache-tomcat-6.0.26\lib folder, but it seems that tomcat isn't able to find this file.
Last time I used tomcat is three years ago and I never used tomcat 6, so I hope someone could help me here.

Best regards,
Michael
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cannot create JDBC driver of class '' for connect URL 'null'


I really hate that message. It means that there's something wrong with your JDBC resource definition and it's not going to tell you what.
 
Michael Oberleitner
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still have the same problem
When additional information is helpful please ask here, because I need db access soon.
 
Michael Oberleitner
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution for this problem is that the server.xml file does not get changed:



It looks like this again.

The context.xml instead looks like this:



After this there is no more-> Cannot create JDBC driver of class '' for connect URL 'null'

regards,
Michael
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic