MySQL connector issue.

Nicko

Expert Member
Joined
Feb 16, 2010
Messages
1,048
Reaction score
1
Location
Cape Town
Hey guys, got this minor issue, but I can't make any more progress until I resolve it. Been spending the last 3 hours scouring the internet, trying to find out how to get Connectors working in Netbeans. It has lead to a very annoyed me, especially seeing as it should be soo simple (the insane heat doesn't help).

So here are the details. I want to get MySQL drivers working as I am getting a "com.mysql.jdbc.Driver" Not found error when I run my program. I am using:
Netbeans IDE 7.0 RC2
Java 7.0 x64
Windows 7 x64

I have downloaded this file: Connector/J the zip version and then went into Netbean libraries and added the .jar to the MySQL JDBC, which didn't work.

It seems to be a very simple task as it hasn't been mentioned much on forums (unless I fail at googling), and the solutions they give are "add it to the library" and that seems to solve it for them, but not for me. Please, I would love any ideas how to solve this, cause would really like to get back on this tomorrow =/

Thanks in advance!
 
Did you make sure that the connector is IN your project file, and you referenced it correctly??

(Sorry, C# guy here, just want to help you debug things..)
 
Did you make sure that the connector is IN your project file, and you referenced it correctly??

(Sorry, C# guy here, just want to help you debug things..)

Okay, I plastered that baby in every folder, still no luck =/ When you say referenced, do you mean with the libraries of Netbeans. Thanks for the tip anyways, will keep at it.
 
This is probably a classpath issue. Why I hate these IDE's.

Although its "in" your project it may not be in the classpath at runtime.

Or you may have conflicting driver versions and it's referencing the wrong one.
 
Okay, I plastered that baby in every folder, still no luck =/ When you say referenced, do you mean with the libraries of Netbeans. Thanks for the tip anyways, will keep at it.

Usually you have to 'add' a reference to the project, usually in its properties. This will cause the solution to grasp the file, and work with it.
In VS2010, its as simple as 'Project > Add Reference", then browsing for the DLL (I know it might not be a DLL in netbeans)

Here kinda gave me the info I needed:
http://netbeans.org/kb/docs/web/mysql-webapp.html
 
Sigh, okay found the problem. I recently updated my Java from 1.6 to 1.7. However my environment Variable was still set to 1.6, and had the connector in the 1.6 directory not the 1.7.

Thanks anyway guys. Now I can finally get back to work ^^
 
Glad you got the issue! Happens more times than you know it ;)

Good luck!
 
Top
Sign up to the MyBroadband newsletter
X