verdictdb / verdictdb-tutorial

1 stars 4 forks source link

loading class `com.mysql.jdbc.Driver'. #2

Closed AchunOrigin closed 6 years ago

AchunOrigin commented 6 years ago

I have changed "Class.forName("com.mysql.jdbc.Driver");" to "Class.forName("com.mysql.cj.jdbc.Driver");" in VerdictTutorialMain.java, but there still has a problem below.

Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

I use my own mysql version 8.0.12 like:

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.12</version>
        </dependency>

mvn package works.

dongyoungy commented 6 years ago

What is the reason behind using your own version of mysql instead of what we have in the tutorial package?

AchunOrigin commented 6 years ago

I did. But it has a problem like:

For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

I have set useSSL=false, it still can't work. So I just change MySQL version to 8.0.12. It works, but the problem again like I said. Orz

dongyoungy commented 6 years ago

It looks like you somehow setting the connection options incorrectly and this does not seem to be a valid reason for us to update our tutorial code that works perfectly fine for current mysql connector version that it supports for general audience.

If you can propose a fix that could work for both connector version (i.e. 5.1.47 and 8.0.12) as a pull request, I am more than happy to look at it and merge it into the repository if possible.

AchunOrigin commented 6 years ago

Thank you for your help.