473,324 Members | 2,179 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,324 software developers and data experts.

Problem with MySQL Connection/J

I try to install MySQL Connection/J on a Windows XP box. MySQL on
localhost works fine. But I cannot load the MySQL Connection/J Driver.
The CLASSPATH variable is set like this:
CLASSPATH=c:\j2sdk1.4.2_04\jre\lib\ext\mysql-connector-java-3.0.14-production-bin.jar
To test it I use this simple code (just to test if the Driver is loaded):
//------------------------------------------------------------------
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class LoadDriverSimple {
public static void main(String[] args) {
Class.forName("com.mysql.jdbc.Driver").newInstance ();
}
}
//-------------------------------------------------------------------

The error messages are:
__________________________________________________ ____________________
C:\AllMyfiles\MyIT-Stuff\java\TNB\JDBC Client\LoadDriverSimple.java:7:
unreported exception java.lang.ClassNotFoundException; must be caught or
declared to be thrown
Class.forName("com.mysql.jdbc.Driver").newInstance ();
^
C:\AllMyfiles\MyIT-Stuff\java\TNB\JDBC Client\LoadDriverSimple.java:7:
unreported exception java.lang.InstantiationException; must be caught or
declared to be thrown
Class.forName("com.mysql.jdbc.Driver").newInstance ();
^
2 errors
__________________________________________________ _______________________

Due to ClassNotFoundExecption-error it cannot find the MySQL
Connection/J classe, why?

Thanks in advance
Peter
Jul 20 '05 #1
0 1899

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: sridhar nagabhurshana | last post by:
hello I am trying to connect to mysql database using connector/J jdbc driver this is my code import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;
1
by: Chinmay Shah | last post by:
hi, when i try to call the mysql_init function it is not getting initilized properly. can someone help me thanks chinmay
6
by: Ian Davies | last post by:
Hello I have the following code to connect to mySQL database from VB6 ******************************************** Private Sub Form_Load() Dim conn As ADODB.Connection Set conn = New...
1
by: James | last post by:
Hey everyone, I have a really obscure but impassable problem with a reasonably simple piece of php/PEAR DB/MySQL code When calling several stored procs the first call succeeds, but subsequent...
0
by: Daniel Crespo | last post by:
Hi to all, I'm using adodb for accessing mysql and postgres. My problem relies on the mysql access. Sometimes, when I try to execute a query (using ExecTrans method below), I get this error:...
1
by: erikcw | last post by:
Hi, I'm trying to insert some data from an XML file into MySQL. However, while importing one of the files, I got this error: Traceback (most recent call last): File "wa.py", line 304, in ?...
10
by: sssk28 | last post by:
i have installed fedora core 6 and i am getting following error: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this...
2
by: dmstn | last post by:
Hey! I've got a little problem. I have to make a web site for a university essay. I curently have to create a search engine. Users can enter a hotel name in a search bar and results have to appear in...
1
by: spatro | last post by:
Hi, I am trying to install DBD::mysql using the CPAN and I am facing the following error: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Warning:...
1
by: manjava | last post by:
Hello, i have a class java conncet to database mysql when i execute the classe alone so execute but when i want to execute this link on web...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.