MySQL JDBC driver not found using mysql driver dependency

Thice

New member
Feb 8, 2024
2
0
1
Dear

I was working on a plugin, that connects to the MySQL database.
When connecting to MySQL the way I did in paper would not work and results in the error: No suitable driver found for <database_url>
I've fixed this by adding: Class.forName("com.mysql.cj.jdbc.Driver");
And adding the MySQL connector dependency. Now I still got the error.
I've also tried to add it via the jar, in the modules, also resulting in the same error.

Java version: 20

See images.

Thank you for the help! :D
 

Attachments

  • maven.png
    maven.png
    124.7 KB · Views: 7
  • error.png
    error.png
    98.5 KB · Views: 6
  • mysql.png
    mysql.png
    32.7 KB · Views: 6
  • pom.png
    pom.png
    28.7 KB · Views: 7

Digital'Inc

New member
Feb 10, 2024
2
0
1
The maven-shade-plugin didn't work for me. What helped me was adding (-cp "path\to\mariadb-java-client-3.3.0.jar") to the startup .bat file. But I would like to do without it. Could you show a minimal working plugin using mysql built through maven?