[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cobalt-developers] problem with mm.mysql jdbc driver
- Subject: [cobalt-developers] problem with mm.mysql jdbc driver
 
- From: "Diana Saunders" <toodi4@xxxxxxxxxxx>
 
- Date: Sun Apr 28 19:50:08 2002
 
- List-id: Discussion Forum for developers on Sun Cobalt Networks products <cobalt-developers.list.cobalt.com>
 
I have jdk installed on my RAQ3.
I have read on this list about the mm.mysql driver.  I downloaded the jar 
file, placed it in the /usr/jakarta-tomcat/lib directory.  I then restarted 
tomcat. (I have also restarted httpd on subsequent attempts)  As a jar file, 
I thought this would be enough.  I did not receive any error messages upon 
restarting, and the jar file showed up in the start-up message.  However, I 
get error messages when trying to use jdbc.  I have read in some posts that 
you need to add the jar file to the classpath.  I did this using the export 
command, yet still have the same problem.  (even if it did work, I don't 
know how to make the classpath change permanent since the changes drop off 
when you log off.)
I have copied below both the jsp page source, and the main part of the error 
message when viewing it.  I hope someone can help.  I know others have had 
similar problems, but I can't find much in the way of a solution.
-------
jsp script
---------
<html>
<head>
</head>
<%@ page language="java" import="java.sql.*" %>
<body>
<%
 Class.forName("org.gjt.mm.mysql.Driver");
// change this as per your requirements
 Connection myConn =
DriverManager.getConnection("jdbc:mysql://localhost/members?user=member&password=testpassword");
 Statement stmt = myConn.createStatement();
 String query = "select * from members";
 ResultSet myResultSet = stmt.executeQuery(query);
 if (myResultSet != null) {
   while (myResultSet.next()) {
     // specify the field name
     String name = myResultSet.getString("name");
%>
<%= name %>
<br>
<%
   }
 }
 stmt.close();
 myConn.close();
%>
</body>
</html>
------------
error message in browser
------------
Root cause:
java.lang.ClassNotFoundException: Unable to load class 
org.gjt.mm.mysql.Driver
       at 
org.apache.jasper.servlet.JasperLoader.findClass(JasperLoader.java:223)
       at 
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:147)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:120)
       at 
_0002fjdbctest_0002ejspjdbctest_jsp_0._jspService(_0002fjdbctest_0002ejspjdbctest_jsp_0.java:64)
       at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
       at 
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
       at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
       at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
       at 
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
       at org.apache.tomcat.core.Handler.service(Handler.java:287)
       at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
       at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
       at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
       at 
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
       at 
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
       at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
       at java.lang.Thread.run(Thread.java:484)
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.