Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2007, 07:17 AM
Authorized User
 
Join Date: Aug 2007
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default "java.lang.classNotFound Exception:org.gjt.mm.mysq

  how can i connect java with mysql



whenever i connect really i am suffer for this problem
"java.lang.classNotFound Exception:org.gjt.mm.mysql.Driver


please any body help me

 
Old September 4th, 2007, 07:20 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try adding the mySql connector jar file [mysql driver] to your class path and then try connecting to the mysql db.

- Rakesh
 
Old September 4th, 2007, 09:24 AM
Authorized User
 
Join Date: Aug 2007
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default


  thanks rakesh
 i already try what you say

i create classpath and denoting mysql jar even it display same error.
my class path as follows



class path="c://programfiles/jdk../lib/mysql.jar";

Is any mistake has myclass path ?


 
Old September 4th, 2007, 09:30 AM
Authorized User
 
Join Date: Aug 2007
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default



        Rakesh i really forget one matter,

i denote both mysql.jar and mysqlconnector.jar
[u]class path</u>

class path="c://progarm files/jdk.../lib/mysql.jar";c://progarm files/jdk.../lib/mysqlconnector.jar"



 
Old September 12th, 2007, 11:04 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by anwarraja



        Rakesh i really forget one matter,

i denote both mysql.jar and mysqlconnector.jar
[u]class path</u>

class path="c://progarm files/jdk.../lib/mysql.jar";c://progarm files/jdk.../lib/mysqlconnector.jar"

MySql Connector is enough.
"classpath" variable name should not have space in it. its a single word. try like
set classpath=%classpath%;c:/program files/jdk.../lib/mysqlconnector.jar;

another thing is because of the space in "program files" the path wont be considered as a valid one in few operating systems like 2003 server and i dought 2000 server also. try placing the connector jar file in an direct folder like c:\mysql\mysqlconnector.jar

Third option you've is place the mysqlconnector.jar file in your JAVA_HOME/JRE/ext/lib directory.

Hope that solves your problem.

- Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.ClassCastException: org.apache.xpath.obj ksskumar XSLT 4 December 15th, 2006 03:13 AM
error:exception in thread main java.lang.noclassde sara.j JSP Basics 0 December 13th, 2006 12:35 AM
Exception : java.lang.NoClassDefFoundError haifriends J2EE 1 July 26th, 2006 07:22 PM
ERROR "Exception in thread "main" java.lang.NoClas nitinnishi BOOK: Beginning Java 2 3 June 17th, 2006 07:07 AM
java.lang.NoClassDefFoundError: org/xml/sax/XMLRea kcheung XSLT 0 August 8th, 2003 08:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.