Exception in connection with mysql through jdbc

后端 未结 3 1382
滥情空心
滥情空心 2020-12-02 01:37

I got exception when i have tried to connect with mysql through jdbc.This type of question is already asked but i didn\'t get solution for my problem, here is my code...

相关标签:
3条回答
  • 2020-12-02 02:09

    Use new Maven dependencies

    mysql mysql-connector-java 8.0.11

        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.11</version>
        </dependency>
    
    0 讨论(0)
  • 2020-12-02 02:13

    I would try to play around the char encoding sets, for instance you can try to use the following url

    String url="jdbc:mysql://localhost:3306/student?autoReconnect=true&useSSL=false&characterEncoding=utf8&useUnicode=true";
    
    0 讨论(0)
  • 2020-12-02 02:25

    I was using a latest version of mysql server with an older version of mysql-connector. Once I updated to the latest connector(8.0.11) this issue cleared up for me.

    0 讨论(0)
提交回复
热议问题