Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver


Advanced Search

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Posted by: yilinglim ()
Date: July 29, 2004 12:36AM

hi there,

i'm failed to connect the MySQL driver, anyone can help me?
i don't know where comes wrong !

following are the script that i type in .jsp ----------->

<%@page contentType="text/html"%>
<%@page import="java.sql.*"%>
<%@page import="javax.servlet.http.*"%>
<%@page import="java.lang.*"%>
<%@page buffer='none'%>

<html>
<head><title>Early Warning System</title></head>
<body>

<%

Connection conn = null;
Statement stm = null;
ResultSet rst=null;

try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://buah:3306/epal","mangga","123456");
stm = conn.createStatement();
out.println("success<br>");
} catch (Exception exc) {
exc.printStackTrace();
out.println(exc.toString());
out.println("failed<br>");
}

String sql = "select distinct Year from sunny";

rst = stm.executeQuery(sql);

while(rst.next()) {
out.print(rst.getString("Year"));
}

%>
Hello..
<%
rst.close();
stm.close();
conn.close();
%>
</body>
</html>
----------------------------------------------------------------------------------------------------------
anything wrong about my script ?? for the Class.forName, i tried
Class.forName("com.mysql.jdbc.Driver").newInstance();
too.... but also cant work..
everytime i run the code, it will display
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver and failed!!

Any help will be appreciated.



Options: ReplyQuote


Subject Written By Posted
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver yilinglim 07/29/2004 12:36AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver madhu sudhan 07/29/2004 10:48PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver sathish kumar 02/07/2008 12:23PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver sathish kumar 02/07/2008 12:29PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Karsten Breivik 09/12/2004 04:24PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Arun kumar 12/02/2004 01:48AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Arina Izvolskaja 01/07/2005 07:45AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Arina Izvolskaja 01/07/2005 07:47AM
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Prameela Nair 01/12/2005 10:29PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver vishal sardana 09/03/2007 12:31AM
help! : java.lang.ClassNotFoundException: com.mysql.jdbc.Driver M K 05/07/2005 02:46AM
help : java.lang.ClassNotFoundException: com.mysql.jdbc.Driver praveen kamineni 01/09/2009 07:33AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver vlada zile 05/11/2005 03:27PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Keith Corlett 08/25/2006 08:12AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Mark Matthews 08/25/2006 09:37AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver vinit pahwa 06/28/2007 02:09AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Dennis Gellert 04/10/2007 10:38PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Mark Matthews 08/25/2006 09:36AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Arul Jose 06/22/2005 01:49AM
Re: Here is the solution phani indra 04/07/2007 11:27PM
Re: Here is the solution anupama reddy 12/26/2007 11:43AM
Re: Here is the solution david bennett 02/05/2008 01:05AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver natarajan nallusamy 01/22/2008 09:00AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Eufemio Jara 02/04/2008 01:56AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Eufemio Jara 02/06/2008 10:19AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver jassen moran 09/13/2008 09:31AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver isuru udayanga 11/01/2008 10:39PM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver vel palsamy 01/07/2009 03:47AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver anmol khanna 03/24/2009 01:09AM
Re: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Johno S 04/06/2009 10:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.