I keep getting the following error:

javax.servlet.ServletException: Unable to get connection, DataSource
invalid: "java.sql.SQLException: No suitable driver"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java :825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(
PageContextImpl.java:758)
org.apache.jsp.TryDB_jsp._jspService(TryDB_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java :94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java :292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I am using Tomcat 5.0.28, JSDK 1.4.2_08 and MySQL 5.0.20a.

Here is a list of what I can think of that I have tried and nothing resolves
the "no suitable driver" error:
1) Made sure that mysql-connector-java-3.1.12-bin.jar contains the JDBC
driver.
2) I have tried putting the MySQL JAR ( mysql-connector-java-3.1.12-bin.jar)
in WEB-INF/lib, common/lib and shared/lib.
3) I have tried putting the MySQL JAR ZIP file
mysql-connector-java-3.1.12.zip in WEB-INF/lib, common/lib and shared/lib
4) I have placed "<% Class.forName("com.mysql.jdbc.Driver"); %>" in the JSP
page.
5) I changed localhost in the URL connection string to 127.0.0.1.
6) I added the MySQL server port 3306 to the URL connection string.
7) I have tried using another MySQL Jar
mysql-connector-java-5.0.0-beta-bin.jar.
8) I have completely uninstalled Tomcat 5.0.28 and reinstalled it.
9) I have completely uninstalled MySQL and reinstalled it, resetting up the
database.
10) I have triple checked the database privileges, login ID (wroxuser),
password (wrox), table (products).

Any suggestions for resolving the "No suitable driver" problem would be
greatly appreciated.

Reply via email to