Spring Boot 测试错误 SQLFeatureNotSupported

提示的错误信息如下:

Caused by: java.sql.SQLFeatureNotSupportedException

spring-boot-test-SQL-01

问题和解决

不知道为什么一直提示上面的错误。

return useCredentials ? dataSource.getConnection( user, pass ) : dataSource.getConnection();

因为上面的这句话 dataSource.getConnection( user, pass ) 在给出用户名和密码的时候提示不能获得连接池的错误。

这是因为在 hibernate.properties 文件中,设置了参数:

hibernate.connection.username=edtestbank

如果要解决上面的问题,需要将用户名和用户名和密码设置到 hibernate.connection.url= 参数中,而不能设置 hibernate.connection.username= 和 hibernate.connection.password= 参数。

spring-boot-test-db-01

说是具体的原因是 JDBC 参数的问题。

如果有知道的同学欢迎进行讨论。

在现在的解决方案就是需要将用户名和密码设置到 URL 参数中。

https://www.ossez.com/t/spring-boot-sqlfeaturenotsupported/13210

猜你喜欢

转载自blog.csdn.net/huyuchengus/article/details/113164205
今日推荐