fix: 校验 ck 出错

This commit is contained in:
taojinlong 2024-09-04 15:34:47 +08:00
parent 6826ed0c0f
commit b27964d202

View File

@ -128,8 +128,18 @@ public class CalciteProvider extends Provider {
default:
break;
}
String querySql = getTablesSql(datasourceRequest).get(0);
try (ConnectionObj con = getConnection(datasourceRequest.getDatasource()); Statement statement = getStatement(con.getConnection(), 30); ResultSet resultSet = statement.executeQuery(querySql)) {
try (ConnectionObj con = getConnection(datasourceRequest.getDatasource())) {
datasourceRequest.setDsVersion(con.getConnection().getMetaData().getDatabaseMajorVersion());
String querySql = getTablesSql(datasourceRequest).get(0);
Statement statement = getStatement(con.getConnection(), 30);
ResultSet resultSet = statement.executeQuery(querySql);
if (resultSet != null) {
resultSet.close();
}
if (statement != null) {
statement.close();
}
} catch (Exception e) {
throw e;
}