spring.xy.datasource.url=jdbc:mysql://azurnae-db013.xxx.yy.net:3306/devdb
spring.xy.datasource.username=user
spring.xy.datasource.password=pass
spring.xy.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.xy.datasource.pool-size=100
Below is the excpetion
could not prepare statement; nested exception is org.hibernate.exception.JDBCConnectionException: could not prepare statement",
答案 0 :(得分:0)
这是我对tomcat webapp的配置:
<Resource name="jdbc/itsme"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
initialSize="1"
maxActive="85"
maxIdle="15"
minIdle="1"
maxWait="10000"
maxAge="3600000"
timeBetweenEvictionRunsMillis="60000"
minEvictableIdleTimeMillis="60000"
validationQuery="SELECT 1"
validationInterval="30000"
testOnBorrow="true"
removeAbandoned="true"
removeAbandonedTimeout="60"
driverClassName="com.mysql.cj.jdbc.Driver"/>
你需要的属性是 minIdle,validationQuery,validationInterval,testOnBorrow 这些配置你不应该再有问题了