Help! JSP w/ struts can't find Class.forName("com.mysql.jdbc.Driver")
843840Apr 24 2008 — edited Apr 24 2008I think this is just a directory structure issue but I can't figure it out. I am writing a JSP / Struts / MYSQL web application which uses the mysql JDBC connector. The connector (mysql-connector-java-5.1.6-bin.jar) is in the referenced libraries. If I write the line of code:
Class.forName("com.mysql.jdbc.Driver");
To load up the driver, it works in JSP files in the folder /projectname/webroot/web-inf just fine and I can go on to execute MySQL queries. However, I need to load up the driver in an action (.java action) with the directory structure /projectname/src/action and it throws the exception "class not found", I believe, it can no longer seem to get to the driver. Can anyone tell me how to resolve this problem?
Thanks in advance, I hope this is the correct place (I have done my best to find the right one).
Edited by: Arkanin on Apr 24, 2008 4:39 PM