Skip to content

Commit

Permalink
修正使用HikariDataSource时CacheDB(2016)生成文档报错的问题
Browse files Browse the repository at this point in the history
修正使用HikariDataSource时CacheDB(2016)生成文档报错的问题
  • Loading branch information
leshalv authored and gitee-org committed Sep 14, 2020
2 parents d6882c7 + 6e5409b commit e890b82
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ protected String getSchema() throws QueryException {
* @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()) {
Expand Down

0 comments on commit e890b82

Please sign in to comment.