mirror of
https://github.com/dataease/dataease.git
synced 2026-05-17 15:00:59 +08:00
refactor: 优化一下
This commit is contained in:
@@ -204,13 +204,16 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
}
|
||||
|
||||
String queryView = getViewSql(datasourceRequest);
|
||||
try (Connection con = getConnectionFromPool(datasourceRequest); Statement statement = con.createStatement(); ResultSet resultSet = statement.executeQuery(queryView)){
|
||||
while (resultSet.next()) {
|
||||
tables.add(resultSet.getString(1));
|
||||
if(queryView != null){
|
||||
try (Connection con = getConnectionFromPool(datasourceRequest); Statement statement = con.createStatement(); ResultSet resultSet = statement.executeQuery(queryView)){
|
||||
while (resultSet.next()) {
|
||||
tables.add(resultSet.getString(1));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(e);
|
||||
}
|
||||
|
||||
return tables;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user