Food for thought: Make Java easier to use and understand.
Food for thought: Make Java easier to use and understand.
Food for thought: Make Java easier to use and understand.
Food for thought: Make Java easier to use and understand.
Originally posted by Paul Sturrock:
This sort of exception happens because:
Your JDBC URL is wrong The driver classes are not in your classpath
Originally posted by stu derby:
Or, while the driver is in your classpath, nothing has loaded it. (Normally, you should get an exception loading the driver class if the driver class is not in the classpath; I suppose it's possible that the sql tag is eating or hiding your exception, but you should look in your application log...)
BTW, the application's classpath is not necessarily inherited from an environmental variable. While a standalone Java program inherit from the environment, most IDEs (such as NetBeans and Eclipse) and most J2EE servers will ignore the the environmental variable. For IDEs, the classpath is set as part of the project setup. For J2EE applications, certain locations such as WEB-INF/lib are in the classpath and are the correct locations for driver jars.
I'd assume that Tomcat follows the J2EE rules, although I've never used it standalone, just with JBoss...
Food for thought: Make Java easier to use and understand.
Food for thought: Make Java easier to use and understand.
Food for thought: Make Java easier to use and understand.
Originally posted by Ernest Friedman-Hill:
You've already been given the answer. Tomcat won't load the driver (or any classes) based on the value of the CLASSPATH environment variable; you must install the driver in Tomcat. That means putting it on the Web application's class path: in WEB-INF/lib, in ${CATALINA_HOME}/shared/lib, or in ${CATALINA_HOME}/common/lib. Any place else, and Tomcat won't find it.
The same goes for any other libraries you use in your web applications.
Food for thought: Make Java easier to use and understand.
Originally posted by Paul Clapham:
Step 1: make sure that mysql-connector-java-3.1.12-bin.jar contains the JDBC driver.
Step 2: put it into the WEB-INF/lib folder of your web application.
Step 3: restart Tomcat.
Food for thought: Make Java easier to use and understand.
Food for thought: Make Java easier to use and understand.
Food for thought: Make Java easier to use and understand.
permaculture is giving a gift to your future self. After reading this tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|