|
|
|
@ -173,14 +173,15 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
urlTextField.setText(dus[i].getURL()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 更改数据库类型后 数据库名称置空和之前逻辑保持一致
|
|
|
|
|
if (needRefresh) { |
|
|
|
|
jdbcDatabase.setDatabase(StringUtils.EMPTY); |
|
|
|
|
// 更改数据库类型后更新数据库名称
|
|
|
|
|
if (needRefresh || StringUtils.isEmpty(jdbcDatabase.getDatabase())) { |
|
|
|
|
jdbcDatabase.setDatabase(dbTypeMap.getOrDefault(GeneralUtils.objectToString(dbtypeComboBox.getSelectedItem()), DefaultDatabaseType.OTHER.getType())); |
|
|
|
|
} |
|
|
|
|
jdbcDatabase.setDatabase(dbTypeMap.getOrDefault(GeneralUtils.objectToString(dbtypeComboBox.getSelectedItem()), DefaultDatabaseType.OTHER.getType())); |
|
|
|
|
|
|
|
|
|
changePane(dbtypeComboBox.getSelectedItem()); |
|
|
|
|
JDBCConnectionDef.getInstance().setConnection((String) dbtypeComboBox.getSelectedItem(), jdbcDatabase); |
|
|
|
|
DatabaseConnectionPane.JDBC.getAdvancedAttrPane().populate(jdbcDatabase); |
|
|
|
|
needRefresh = true; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
private HashBiMap<String, String> nameAndRepresent; |
|
|
|
@ -414,6 +415,7 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
DriverURLName[] dus = entry.getValue(); |
|
|
|
|
for (int i = 0, len = dus.length; i < len; i++) { |
|
|
|
|
if (ComparatorUtils.equals(dus[i].getDriver(), jdbcDatabase.getDriver())) { |
|
|
|
|
needRefresh = false; |
|
|
|
|
this.dbtypeComboBox.setSelectedItem(entry.getKey()); |
|
|
|
|
out = true; |
|
|
|
|
break; |
|
|
|
@ -454,7 +456,6 @@ public class JDBCDefPane extends JPanel {
|
|
|
|
|
} else { |
|
|
|
|
this.charSetComboBox.setSelectedItem(jdbcDatabase.getOriginalCharsetName()); |
|
|
|
|
} |
|
|
|
|
needRefresh = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JDBCDatabaseConnection update() { |
|
|
|
|