jdbc and mysql
I am currently using jdbc to connect to a mysql database with the mysql driver mysql-connector-java-3.0.11-stable.jar (com.mysql.jdbc.Driver). It works just fine in JBuilder once it was added to JBuilders internal classpath. But no matter what I do I can't manage to get it to run from a jar file after setting windows xp pro classpath. Here is my classpath.
The correct path for the file is:
I have also tried unzipping the jar file and then changing the class file to match the correct path but anyway I go I still get an exception.
I have rebooted since I changed the path. I have also tried manually setting the classpath when I exec the jar file with
java -cp C:\mysql\jdbc\mysql-connector-java-3.0.11-stable.jar -jar Res.jar
Any help is great, Its about to drive me crazy. Thanks
your classpath is incorrect.
you cannot edit the environment variable in that way and have your classpath come correct..
edit the classpath (right click my computer.. properties.. advanced.. env vars.. system vars.. classpath.. edit) to be:
then DO NOT PUT the -cp switch into java..
java -jar Res.jar
no need to reboot, but you MUST close all command prompt windows and open a new one after you edit the variable
note that your java2 sdk might not be installed at that location.. edit the path, or better, edit the path in the JAVA_HOME dir, then make your classpath to be:
%JAVA_HOME%\jre\lib\rt.jar...(and so on)
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL