473,394 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Exception in thread "main" java.lang.NoClassDefFoundError: MySQLJDBCDriverTest

58
What is ths error.????? I m nw loading the JDBC driver for connection with MySql.

Exception in thread "main" java.lang.NoClassDefFoundError: MySQLJDBCDriverTest
Sep 17 '07 #1
9 3093
madhoriya22
252 100+
What is ths error.????? I m nw loading the JDBC driver for connection with MySql.

Exception in thread "main" java.lang.NoClassDefFoundError: MySQLJDBCDriverTest
Hi,
I think you have not provided the path of you MysqlConnector.jar to the class path. Try this.
Sep 17 '07 #2
jith87
58
Hi,
I think you have not provided the path of you MysqlConnector.jar to the class path. Try this.

No i ve provided the path to the connector.
Sep 17 '07 #3
madhoriya22
252 100+
No i ve provided the path to the connector.
Hi,
Can u send the code(relevant) line exactly where you are getting the exception
Sep 17 '07 #4
jith87
58
Hi,
Can u send the code(relevant) line exactly where you are getting the exception
hi ths s the code......

import java.lang.*;
import java.sql.*;

public class sample2
{
public static void main(String[] args)
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance ();
System.out.println("Good to go");
}

catch (Exception E)
{
System.out.println("JDBC Driver error");
}
}
}
Sep 17 '07 #5
madhoriya22
252 100+
hi ths s the code......

import java.lang.*;
import java.sql.*;

public class sample2
{
public static void main(String[] args)
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance ();
System.out.println("Good to go");
}

catch (Exception E)
{
System.out.println("JDBC Driver error");
}
}
}
Hi,
When I run your code in my system ..... It worked properly. So again I vil suggest you to check all your classpaths. Are you running your application from command prompt or in some IDE ?
Sep 17 '07 #6
jith87
58
Hi,
When I run your code in my system ..... It worked properly. So again I vil suggest you to check all you classpaths. Are you running your application from command prompt ?

Yes i m running ths in application prompt.....
Sep 17 '07 #7
r035198x
13,262 8TB
hi ths s the code......

import java.lang.*;
import java.sql.*;

public class sample2
{
public static void main(String[] args)
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance ();
System.out.println("Good to go");
}

catch (Exception E)
{
System.out.println("JDBC Driver error");
}
}
}
1.) Use code tags
2.) How did you specify the path to the connector jar?
Sep 17 '07 #8
jith87
58
1.) Use code tags
2.) How did you specify the path to the connector jar?
What is meant by code tags?

D:\mysql-5.0.45-win32\mysql-connector-java-3.1.14\mysql-connector-java-3.1.14-bin.jar;%CLASSPATH%

ths s the classpath variable address i ve mentioned. mysql-5.0.45-win32 is the name of the folder whr mysql is installed.. then mysql-connector-java-3.1.14 is the folder (downloaded frm mysql.com) whr the connector is situated. mysql-connector-java-3.1.14-bin.jar is the .jar file..... dat %CLASSPATH% was specified in book i jus followed actually i m a beginner in java n jdbc so i dunno wht it exactly means.....If u can pls suggest me a buk for jdbc connectivity wid mysql.

ths program is being run in command prompt.
Sep 17 '07 #9
madhoriya22
252 100+
What is meant by code tags?

D:\mysql-5.0.45-win32\mysql-connector-java-3.1.14\mysql-connector-java-3.1.14-bin.jar;%CLASSPATH%

ths s the classpath variable address i ve mentioned. mysql-5.0.45-win32 is the name of the folder whr mysql is installed.. then mysql-connector-java-3.1.14 is the folder (downloaded frm mysql.com) whr the connector is situated. mysql-connector-java-3.1.14-bin.jar is the .jar file..... dat %CLASSPATH% was specified in book i jus followed actually i m a beginner in java n jdbc so i dunno wht it exactly means.....If u can pls suggest me a buk for jdbc connectivity wid mysql.

ths program is being run in command prompt.
Hi,
I will suggest you to read some tutorials on classpath. I have found these, suitable for you ...
http://java.sun.com/j2se/1.3/docs/to...classpath.html
http://mindprod.com/jgloss/classpath.html
I hope this will help you :)
Sep 17 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Phillip Montgomery | last post by:
Hello all; I'm trying to debug an issue with a java script called, SelectSockets. It appears to be a fairly common one found on the web. I downloaded the SGI Java v1.4.1 installation from SGI's...
1
by: Andy Howells | last post by:
Can anybody help me on this? I am getting the below error but have not got a clue why. The file in my classpath eing used has the class that it says is not defined. Any ideas? I am running java...
7
by: news | last post by:
I am pretty new to Java and I just install the JDK1.4.2 03 I am getting an error when I run the class file TestChart.class with the java.exe: Exception in thread "main"...
4
oll3i
by: oll3i | last post by:
when i try to run the client application java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost i get an error exception in thread "main" java.lang.NoClassDefFoundError:HelloClient ...
3
by: Ananthu | last post by:
Hi This is my codings in order to access mysql database from java. Codings: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement;
9
by: tiyaramunna | last post by:
I am trying to configure my system with Java program just to practice on the coding....when i compile a test.java program i am able to see the class file but i cant run the program ... I am getting...
4
by: jmitch89 | last post by:
I don't why I get this error: Exception in thread "main" java.lang.NoClassDefFoundError The statement below works just fine: java -cp...
3
by: ohadr | last post by:
hi, i get Exception in thread "main" java.lang.NullPointerException when i run my application. the exact error is: "Exception in thread "main" java.lang.NullPointerException at...
1
by: onlinegear | last post by:
HI i am writing this for college i know i have loads of combo boxes with nothing in the i havent got that far yet. but every time i run this is comes up with this erro run: Exception in thread...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.