rameshfaj Posted July 3, 2007 Share Posted July 3, 2007 Hi everyone,I am using windowsXp and want to connect the JAVA programs to use the mysql connection. I have also downloaded the connector mysql-connector-java-3.1.14-bin-g.jar and specified its path in the Administrator/Uservariable(Environment variable) as the CLASSPATH. But when the java files are run,it generates the error:NoSuitableDriver found Exception. Am i wrong with the classpath or what? Any kind of help are heartly accepted. Quote Link to comment https://forums.phpfreaks.com/topic/58167-solved-mysql-connection-with-java/ Share on other sites More sharing options...
morphboy23 Posted July 3, 2007 Share Posted July 3, 2007 Usuall when you modify environment variables, you have to restart your system. Have you tried that? If not, do, then see if it works. Quote Link to comment https://forums.phpfreaks.com/topic/58167-solved-mysql-connection-with-java/#findComment-288540 Share on other sites More sharing options...
rameshfaj Posted July 3, 2007 Author Share Posted July 3, 2007 I have modified only the Administrator/user variable.Though i do restarting also but the same problem exists. The error generated is: Exception in thread "main" java.lang.NoClassDefFoundError:org/aspectj/lang/Signature at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown source) at LoadDriver.main(LoadDriver.java:10) Quote Link to comment https://forums.phpfreaks.com/topic/58167-solved-mysql-connection-with-java/#findComment-288547 Share on other sites More sharing options...
rameshfaj Posted July 3, 2007 Author Share Posted July 3, 2007 I have modified only the Administrator/user variable.Though i do restarting also but the same problem exists. The error generated is: Exception in thread "main" java.lang.NoClassDefFoundError:org/aspectj/lang/Signature at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown source) at LoadDriver.main(LoadDriver.java:10) The code was: import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class LoadDriver { public static void main(String[] args) { try { // The newInstance() call is a work around for some // broken Java implementations Class.forName("com.mysql.jdbc.Driver").newInstance(); } catch (Exception ex) { System.out.println("Error"+ex); // handle the error } } } Quote Link to comment https://forums.phpfreaks.com/topic/58167-solved-mysql-connection-with-java/#findComment-288548 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.