For more information on how to add DB2 coordinates in a MAVEN project, see: Https://www.cnblogs.com/zifeiy/p/7918554.html
The contents of the Application.properties file in the Spring boot project are as follows:
# DB Configuration for DB2 spring.datasource.url=jdbc:db2://localhost:50000/SAMPLE
spring.datasource.username=zifeiy
spring.datasource.password=izzzyc
spring.datasource.driver-class-name=com.ibm.db2.jcc.DB2Driver # logging logging.level.com.zifeiy.demo=debug
Later found that this is actually no problem.
The solution is: DB2JCC dependency removed, leaving db2jcc4 on it.
In other words, the following is commented out in Pom.xml:
<!-- https://mvnrepository.com/artifact/com.ibm.db2/db2jcc -->
<!-- dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc</artifactId>
<version>8.1</version>
</dependency> -->
Reference Link: Https://stackoverflow.com/questions/37193965/java-lang-abstractmethoderror-com-ibm-db2-jcc-t4-b-isvalidiz
Spring Boot connection DB2 query results times wrong "java.lang.abstractmethoderror:com.ibm.db2.jcc.t4.b.isvalid (I) Z" Workaround