본문 바로가기
Developer/DB

[DB] Loading class `com.mysql.jdbc.Driver'.

by 순수한소년 2021. 8. 6.
728x90
반응형

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

 

인터넷 찾아보면

context-datasource.xml의 driverClassName을

기존 뭐로 되어 있던 com.mysql.cj.jdbc.Driver로 바꾸라고 한다.

 

하지만, 아래의 출처에서

https://stackoverflow.com/questions/52032739/loading-class-com-mysql-jdbc-driver-this-is-deprecated-the-new-driver-class?noredirect=1&lq=1 

 

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'

This is the Warning im getting in console, Im confused with this warning: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is

stackoverflow.com

 

댓글 중

This is beacuse the version of mysql to be connected is lower than the version of the mysql driver. Many people say that com.mysql.jdbc.Driver is changed to com.mysql.cj.jdbc.Driver , although this does not solve the problem, but it should also attract attention.

 

단순히 번역기 돌려서 확인하니, 

연결할 mysql의 버전이 mysql 드라이버의 버전보다 낮기 때문입니다. 많은 사람들이 com.mysql.jdbc.Driver 를 com.mysql.cj.jdbc.Driver 로 변경한다고 말합니다. 이렇게 하면 문제가 해결되지는 않지만 주의를 끌기도 합니다.

 

결국 버전을 본인이 사용중인, Mysql버전 또는 Java버전과 JDBC의 버전이 맞지 않아 발생하는 에러이다.

 

아래의 링크를 통해 Mysql버전을 다운받을 수 있다.

https://mvnrepository.com/artifact/mysql/mysql-connector-java

 

728x90
반응형