修正使用HikariDataSource时CacheDB(2016)生成文档报错的问题.

This commit is contained in:
Josway
2020-09-04 17:54:39 +08:00
parent 71bfe8ab1e
commit 6e5409b135

View File

@@ -140,7 +140,13 @@ public abstract class AbstractDatabaseQuery implements DatabaseQuery {
* @return Schema
*/
private String verifySchema(DataSource dataSource) throws SQLException {
String schema = dataSource.getConnection().getSchema();
String schema;
if (dataSource instanceof HikariDataSource) {
schema = ((HikariDataSource) dataSource).getSchema();
} else {
schema = dataSource.getConnection().getSchema();
}
//验证是否有此Schema
ResultSet resultSet = this.getConnection().getMetaData().getSchemas();
while (resultSet.next()) {