# Spring Boot 测试错误 SQLFeatureNotSupported

**URL:** <https://www.isharkfly.com/t/spring-boot-sqlfeaturenotsupported/13210>\
**Category:** 程序语言\
**Tags:** java, spring\
**Created:** [January 25, 2021, 7:09pm UTC](https://www.isharkfly.com/t/spring-boot-sqlfeaturenotsupported/13210 "2021-01-25T19:09:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [January 25, 2021, 7:09pm UTC](https://www.isharkfly.com/t/spring-boot-sqlfeaturenotsupported/13210/1 "2021-01-25T19:09:30Z")

</div>

提示的错误信息如下：

```auto
Caused by: java.sql.SQLFeatureNotSupportedException

```

![spring-boot-test-SQL-01](https://www.isharkfly.com/images/transparent.png)

## 问题和解决

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

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

```

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

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

```auto
hibernate.connection.username=edtestbank

```

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

![spring-boot-test-db-01](https://www.isharkfly.com/images/transparent.png)

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

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

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