I have a problem with the jdbc classpath in Java. I am using Maven, but jdbc is not handable within maven, so I created a "lib" folder with the mysql-connector.jar und added this jar to the build path of the project.
If I run it local in eclipse it is all working fine, but when I put the project on my server and try to run it via command line it prints out this error:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/eventlist
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at WriteData.writeEventDataToDatabase(WriteData.java:24)
at Main.main(Main.java:6)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
at java.lang.Thread.run(Thread.java:745)
I am using Java 1.8.0_60 and Maven 3.0.5 on CentOS 6. I hope you can tell me how the add the jdbc file to the classpath.
thanks!
mvn:installandmvn installand then path to the jar, but it did not work-bash: mvn:install: command not found