public Datasets getDataSet(DataBaseDto dataBaseDto, Workspace workspace){
Datasources datasources = workspace.getDatasources();
DatasourceConnectionInfo datasourceConnectionInfo = new DatasourceConnectionInfo();
datasourceConnectionInfo.setEngineType(dataBaseDto.getEngineType());
if(dataBaseDto.getDriver()!=null){
datasourceConnectionInfo.setDriver(dataBaseDto.getDriver());
}
datasourceConnectionInfo.setServer(dataBaseDto.getServer());
if (dataBaseDto.getEngineType().equals(EngineType.SQLPLUS)) {
datasourceConnectionInfo.setDatabase(dataBaseDto.getDatabase());
}
datasourceConnectionInfo.setUser(dataBaseDto.getUsername());
datasourceConnectionInfo.setPassword(dataBaseDto.getPassword());
datasourceConnectionInfo.setAlias(dataBaseDto.getServer());
String database = datasourceConnectionInfo.getDatabase();
if(StringUtils.isNotBlank(database)){
log.info("数据库名称--"+database);
}
Datasource datasource = datasources.open(datasourceConnectionInfo);
//得到数据集集合类,模板方式新建点数据集
Datasets datasets = datasource.getDatasets();
String datasetVectorName = "del_recordset";
if (datasets.contains(datasetVectorName))
datasets.delete(datasetVectorName);
return datasets;
}