There is a program that works with the database using JDBC. In intellij Idea, the program works fine, but as soon as I compile it manually and try to run it from the command line, I get an exception.

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/blabla at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) 

I launch using the following command:

 java -cp .;"D:\libs\poi-3.14-20160307.jar" Main 

Like the way to the library indicated.

If you need source code - add a question.

    1 answer 1

    The jdbc driver jar should also be added to the classpath: java -cp.; Mysql-connector-java-5.1.23-bin.jar; "D: \ libs \ poi-3.14-20160307.jar" Main