Failed to obtain JDBC Driver for MySQL under Tomcat environment

前端 未结 2 1155
别跟我提以往
别跟我提以往 2020-12-21 08:30

I\'ve been trying to obtain the Driver class for JDBC connection to MySQL. The workstation is running on Linux, Fedora 10. I have manually set up the classpath variable for

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-21 09:15

    This shows that I've added the lastest mysql connection jar archive to my CLASSPATH variable.

    Too bad for you that Tomcat (and all other Java EE app servers) ignore any system CLASSPATH environment variable.

    You are supposed to add JDBC driver JARs in either one of two places:

    1. WEB-INF/lib for your web context, which means it's available ONLY to your app (might not be a bad thing)
    2. In the Tomcat server/lib if you're using version 5.x or /lib if you're using version 6.x.

    I believe that Tomcat 6.x requires that you put JDBC driver JARs in /lib.

提交回复
热议问题