MySQL: ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long – Fix

The problem seems with versions of MySQL in combination with old version of mysql-connector.jar. Just tried with below mysql-connector.jar version with MySQL 8.0 and seems to work for me perfectly.

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.4.4</version>
	<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<scope>runtime</scope>
	<version>8.0.23</version>
</dependency>