Hi all,
Can somebody help me out with this JSP problem below please. I cannot get a connection to a MySQL database using JSP (on Linux/JDK1.2/Apache/Tomcat) with the mm.mysqlDriver from sourceforge.net. We have installed the driver but the problem seems to be that it cannot be 'loaded'?!? Here is the URL below:
And here is the code:
html>
<head>
<title>Testing MySQL with Tomcat</title>
</head>
<%@ page import="java.sql.*" %>
<%
String connectionURL = "jdbc:mysql://scweb.sandiego.edu:3306/db?user=user;password=pwd";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>
<%
Class.forName("org.gjt.mm.mysql.Driver".newInstance();
connection = DriverManager.getConnection(connectionURL, "", ""
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM test"
while (rs.next()) {
out.println(rs.getString("testname"+"<br>"
}
rs.close();
%>
<body bgcolor="#FFFFFF" text="#000000">
Whasssssupppppppppp Tomcat?
</body>
</html>
_________________________________________________________
Internal Servlet Error:
javax.servlet.ServletException: Unable to load class org.gjt.mm.mysql.Driver
at org.apache.jasper.runtime.PageContextImpl.handlePageException(Compiled Code)
at jsp._0002fjsp_0002fdbtest_00032_0002ejspdbtest2_jsp_0._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
at org.apache.tomcat.core.ContextManager.service(Compiled Code)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compiled Code)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)
Root cause:
java.lang.ClassNotFoundException: Unable to load class org.gjt.mm.mysql.Driver
at org.apache.jasper.servlet.JasperLoader.findClass(Compiled Code)
at org.apache.jasper.servlet.JasperLoader.loadClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Compiled Code)
at jsp._0002fjsp_0002fdbtest_00032_0002ejspdbtest2_jsp_0._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
at org.apache.tomcat.core.ContextManager.service(Compiled Code)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compiled Code)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)
Thanks for any help - I'd really appreciate it!
Can somebody help me out with this JSP problem below please. I cannot get a connection to a MySQL database using JSP (on Linux/JDK1.2/Apache/Tomcat) with the mm.mysqlDriver from sourceforge.net. We have installed the driver but the problem seems to be that it cannot be 'loaded'?!? Here is the URL below:
And here is the code:
html>
<head>
<title>Testing MySQL with Tomcat</title>
</head>
<%@ page import="java.sql.*" %>
<%
String connectionURL = "jdbc:mysql://scweb.sandiego.edu:3306/db?user=user;password=pwd";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>
<%
Class.forName("org.gjt.mm.mysql.Driver".newInstance();
connection = DriverManager.getConnection(connectionURL, "", ""
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM test"
while (rs.next()) {
out.println(rs.getString("testname"+"<br>"
}
rs.close();
%>
<body bgcolor="#FFFFFF" text="#000000">
Whasssssupppppppppp Tomcat?
</body>
</html>
_________________________________________________________
Internal Servlet Error:
javax.servlet.ServletException: Unable to load class org.gjt.mm.mysql.Driver
at org.apache.jasper.runtime.PageContextImpl.handlePageException(Compiled Code)
at jsp._0002fjsp_0002fdbtest_00032_0002ejspdbtest2_jsp_0._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
at org.apache.tomcat.core.ContextManager.service(Compiled Code)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compiled Code)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)
Root cause:
java.lang.ClassNotFoundException: Unable to load class org.gjt.mm.mysql.Driver
at org.apache.jasper.servlet.JasperLoader.findClass(Compiled Code)
at org.apache.jasper.servlet.JasperLoader.loadClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Compiled Code)
at jsp._0002fjsp_0002fdbtest_00032_0002ejspdbtest2_jsp_0._jspService(Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
at org.apache.tomcat.core.ContextManager.service(Compiled Code)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compiled Code)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)
Thanks for any help - I'd really appreciate it!