It doesn't work. I put the zip file in almost every directory in the c:/jbuilder6/
I don't know... Still get the 3 problems... Should I try an earlier version or maybey jbuilder 7 or 8?
Main Topics
Browse All TopicsHi, i got the following problem:
I put the mysql-connector-java-3.0.4
Now i wanna load the JDBC driver with the following:
Class.forName("com.mysql.j
Now i get 3 errors:
"opstarten.java": Error #: 360 : unreported exception: java.lang.ClassNotFoundExc
"opstarten.java": Error #: 360 : unreported exception: java.lang.IllegalAccessExc
"opstarten.java": Error #: 360 : unreported exception: java.lang.InstantiationExc
this is my script for the main class: opstarten
package quiztool;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.ResultSet;
public class opstarten {
public opstarten() {
Class.forName("com.mysql.j
}
public static void main(String[] args) {
opstarten opstarten1 = new opstarten();
FrameHoofdscherm FrameHoofdscherm1 = new FrameHoofdscherm();
}
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Run this with the parameter 'java.ext.dirs' (no quotes) and tell me what you see:
public class Props {
public static void main(String[] args){
if(args.length > 0){
for(int i = 0;i < args.length;i++){
System.out.println(System.
}
}
else {
System.getProperties().lis
}
}
}
Ducolo,
The problem you're seeing is because the driver file is not in the classpath.
In the windows console, type out the following
set CLASSPATH=%CLASSPATH%;dire
(replace 'directory_with_driver_zip
then, execute your program with:
java opstarten
Hope this helps!
I executed the following:
1st:
c:\JBuilder6\jdk1.3.1\bin\
2nd:
c:\JBuilder6\jdk1.3.1\bin\
Then went back to Jbuilder, running, error:
"Props.java": Error #: 302 : cannot access class java.ext.dirs; java.io.IOException: class not found: class java.ext.dirs at line 2, column 17
I still don't have a clue, do you?
reg.
Duco
CEHJ,
Just because I've happened to reply to two separate questions after you've done so, it doesn't mean that I'm copying your answers. And I believe we're both here to solve problems, not bicker. I think I'll just avoid responding to anything else so that you'll cool off a bit :-).
Relax!
Thanks,
Dronacharya
This was your message:
--------
Run this with the parameter 'java.ext.dirs' (no quotes) and tell me what you see:
public class Props {
public static void main(String[] args){
if(args.length > 0){
for(int i = 0;i < args.length;i++){
System.out.println(System.
}
}
else {
System.getProperties().lis
}
}
}
------
this means that i wrote:
import java.ext.dirs;
Or is that not right?
C:\JBuilder6\jdk1.3.1\bin\
I added a class to "confige JDK". It now says:
C:\JBuilder6\jdk1.3.1\bin\
I was simply trying to help you sort out that horrible mess of classpath you've just shown me. For one thing, windows has a habit of running out of environment variable space when things like this get too long.
If you wnat to keep your classpath then copy
mysql-connector-java-3.0.4
to
C:\JBuilder6\jdk1.3.1\jre\
C:\JBuilder6\jdk1.3.1\jre\
to
C:\JBuilder6\jdk1.3.1\jre\
The mysql-connector-java-3.0.4
You must extract the zip first (at least the mysql-connector-java-3.0.4
You also need to catch the ClassNotFoundException thrown by Class.forName().
I can load the driver now. It was a catch/try case...
Now i want to connect to an online database. Is the following possible?
"jdbc:mysql://ftp://neusho
or should it be this?
"jdbc:mysql://ftp://neusho
thankx....
>>I added a class to "confige JDK". It now says:...
That was what fixed the problem almost certainly.
>>or should it be this?
You shouldn't have more than one protocol, so just lose the ftp://
I was wrong, it doesnt load the driver. This is the full script...
package quiztool;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.ResultSet;
import java.sql.Driver;
import java.io.*;
/**
* Title: QuizTool
* Description: Dit is de quiz tool die nodig is om de digitale quiz te beheren. Deze tool wordt gemaakt in opdracht voor dhr Berry.
* Copyright: Copyright (c) 2002
* Company: HHS
* @author Nathalie Vrolijk, Christian Güde, Duco Risselada, Ronald van der Linden
* @version 1.0
*/
public class opstarten {
public opstarten() {
//driver wordt geladen
try {
Class.forName ("com.mysql.jdbc.Driver");
} //end try
catch (ClassNotFoundException classNotFound ) {
System.err.println("Failed
}; //end catch
java.sql.Connection conn;
try {
conn = DriverManager.getConnectio
"jdbc:mysql://neushoorn:Ch
} //end try
catch (Exception e) {
System.err.println("proble
} //end catch
} // end public opstarten
public static void main(String[] args) {
opstarten opstarten1 = new opstarten();
FrameHoofdscherm FrameHoofdscherm1 = new FrameHoofdscherm();
}
}
----
why can't i get this thing to work probably...
:(
I've given you two different ways to load the driver already, but here goes again:
classpaths are pretty grim, but since they are used by JBuilder, do the following:
1. mysql-connector-java-3.0.4
should be in C:\JBuilder6\jdk1.3.1\jre\
2. Add that package at that path to JBuilder
I did the following:
Database Drivers page of the Tools|Enterprise Setup dialog box
here i added the mysql driver...
the help function says:
"Click OK. JBuilder creates a new .library file in the JBuilder /lib directory with the name you specified (for example, InterClient.library). It also returns you to the Database Drivers page which displays the name of the corresponding .config file in the list which will be derived from the library file (for example, InterClient.config). Select the new .config file in the database driver list and click OK. This places the .config file in the JBuilder /lib/ext directory."
but still it doesn't work...
Not to say the same thing twice, but since it hasn't been attempted yet and my mailbox is filling up with messages from this question, Ill say it again (hopefully more clearly):
The "mysql-connector-java-3.0.
There are class files in the distribution. However they are NOT in the appropriate directories within the zip to work properly. You would have to unzip the whole file and put the directory "mysql-connector-java-3.0.
Simply extract the "mysql-connector-java-3.0.
View the readme included in the zip for more explicit instructions.
>>Now, how do i connect to a mySQL database?
OK - we've been through *that* before as well. This was my suggestion:
>>I would recommend you try to connect from MySql itself until you get the string right. The first one looks better btw
I can't tell you what the database is, but i recommend you get the connection parameters sorted out *in MySql* i.e. from the program independently of Java until you can connect. Then transfer the parameters into your Java program
If you put your mysql-connector-java-3.0.4
connect to the data base with URL: jdbc:mysql://localhost/tes
This worked for me using the command prompt. As previously mentioned you don't need to set the classpath.
To make it work in Jbuilder I had to go through all the steps mentioned above and add in the Datapilot - view - options - driver(tab) add(com.mysql.jdbc.Driver)
Business Accounts
Answer for Membership
by: CEHJPosted on 2003-01-13 at 02:04:03ID: 7716007
Put mysql-connector-java-3.0.4 -gamma.zip in %JAVA_HOME%\jre\lib\ext