I developed an employee registration system. In this system the persistence of the data is done in a mysql database. When I run the program through the package the system works normally, but when I run an executable jar it does not find the mysql driver.
The mysql Driver is in the path below:
c:\jars\jdbc_mysql.jar
The main class of the application is in the package below:
br\com\vl1\principal\SistemaCadastro.java
Running as below, the system works:
c:\raiz\java -cp c:\jars\jdbc_mysql.jar;. br.com.vl1.principal.SistemaCadastro
But when I run the form below it does not find Driver Mysql
c:\raiz\java -cp c:\jars\jdbc_mysql.jar;. -jar SistemaCadastro.jar
The jar was generated with the following command:
jar -cvfm SistemaCadastro.jar META-INF\MANIFEST.MF br
Below is the exception generated when trying to save a record to the database:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/sistema_cadastro
The entire process was run from the command prompt. I am not using IDE and would like a command line solution.
If someone can help me, I'll thank you right away.