Browse Source

Pull request #14988: 无jira任务,适配驱动改动

Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/release to fbp/release

* commit 'eb911e021a6128d42d137d053631693412d43653':
  无jira任务,适配驱动改动
fbp/merge
Destiny.Lin-林锦龙 3 months ago
parent
commit
9fe8ad5403
  1. 21
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

21
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fanruan.datasource.driver.bean.DriverLoaderBean;
import com.fine.swing.ui.layout.Layouts; import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
@ -361,7 +362,7 @@ public class JDBCDefPane extends JPanel {
private void initMap() { private void initMap() {
Map<String, DriverLoader> driverLoaders = null; Map<String, DriverLoader> driverLoaders = null;
try { try {
driverLoaders = ConnectionRepository.getInstance().getDriverLoaders(); driverLoaders = toDriverLoaders(ConnectionRepository.getInstance().getDriverLoaders());
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
driverLoaders = new HashMap<>(); driverLoaders = new HashMap<>();
@ -370,6 +371,24 @@ public class JDBCDefPane extends JPanel {
nameAndRepresent = getDriverLoaderAndRepresent(driverLoaders); nameAndRepresent = getDriverLoaderAndRepresent(driverLoaders);
} }
private Map<String, DriverLoader> toDriverLoaders(Map<String, DriverLoaderBean> driverLoaders) {
Map<String, DriverLoader> map = new HashMap<>();
for (Map.Entry<String, DriverLoaderBean> entry : driverLoaders.entrySet()) {
map.put(entry.getKey(), createDriverLoader(entry.getValue()));
}
return map;
}
private DriverLoader createDriverLoader(DriverLoaderBean value) {
DriverLoader driverLoader = new DriverLoader();
driverLoader.setName(value.getName());
driverLoader.setDriverClass(value.getDriverClass());
driverLoader.setDriverJarFiles(value.getDriverJarFiles());
driverLoader.setLoadingStrategy(value.getLoadingStrategy());
driverLoader.setDriverList(value.getDriverList());
return driverLoader;
}
private HashBiMap<String, String> getDriverLoaderAndRepresent(Map<String, DriverLoader> driverLoaders) { private HashBiMap<String, String> getDriverLoaderAndRepresent(Map<String, DriverLoader> driverLoaders) {
HashBiMap<String, String> driverHashBiMap = HashBiMap.create(); HashBiMap<String, String> driverHashBiMap = HashBiMap.create();
if (WorkContext.getCurrent().isWarDeploy()) { if (WorkContext.getCurrent().isWarDeploy()) {

Loading…
Cancel
Save