July 10th, 2003, 11:40 AM
JSP MySQL Connectivity Problem
I am having a problem retrieving data from my DB via my JSP. I know that MySQL, Tomcat and Apache are all functioning correctly independently. However, I don't know if I have Connector J configured correctly. Right now the Connector J 3.0.8 jar file is located in my Java extensions folder. I have not done anything with environment variables. NO CLASSPATH and NO JAVA_HOME. I am having this problem on Mac OS X. I have successfully run all my code on PC. I am running:
OS X Jaguar Server
I'm using this for a connection:
conn = DriverManager.getConnection("jdbc:mysql://localhost/dandi");
I know that my jsp code is running correctly since it is printing my exception in the browser. The connection to sql is simply not happening and I know it is a result of my ignorance on this subject. Any guidance would be greatly appreciated. Thanks
July 10th, 2003, 07:17 PM
Are you getting a ClassNotFound exception for org.gjt.mm.mysql.Driver?
July 10th, 2003, 09:33 PM
Place the mysql jdbc jar file in the classes folder of the web-inf folder for the web project or place it in the class loader if you want to use it for all projects.
July 10th, 2003, 10:39 PM
Reply 1. Yes, I am getting the ClassNotFound exception for the Driver.
Reply 2. The mysql jdbc jar file? Is that the same as the connector J driver? I will try to move the connector J file in there in the morning.
July 11th, 2003, 12:57 PM
Thanks for the suggestion. This worked.