Browse Source

Pull request #3907: REPORT-50096 FR远程BI,未改动配置,确认保存后配置发生变化

Merge in DESIGN/design from ~HADES/design:bugfix/10.0 to bugfix/10.0

* commit 'cc5c4753c9fc73d916ba182007e1fff75873f769':
  REPORT-50096 fix 预防npe
  REPORT-50096 FR远程BI,未改动配置,确认保存后配置发生变化
bugfix/10.0
Hades 4 years ago
parent
commit
8746ba08fb
  1. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

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

@ -99,6 +99,8 @@ public class JDBCDefPane extends JPanel {
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor();
private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor(); private IntegerEditor DBCP_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor();
private JDBCDatabaseConnection jdbcDatabase;
public JDBCDefPane() { public JDBCDefPane() {
this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":"));
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
@ -202,6 +204,7 @@ public class JDBCDefPane extends JPanel {
if (jdbcDatabase == null) { if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection(); jdbcDatabase = new JDBCDatabaseConnection();
} }
this.jdbcDatabase = jdbcDatabase;
if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver")
&& jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { && jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) {
this.dbtypeComboBox.setSelectedItem("Access"); this.dbtypeComboBox.setSelectedItem("Access");
@ -235,6 +238,7 @@ public class JDBCDefPane extends JPanel {
if (dbcpAttr == null) { if (dbcpAttr == null) {
dbcpAttr = new DBCPConnectionPoolAttr(); dbcpAttr = new DBCPConnectionPoolAttr();
jdbcDatabase.setDbcpAttr(dbcpAttr); jdbcDatabase.setDbcpAttr(dbcpAttr);
this.jdbcDatabase.setDbcpAttr(dbcpAttr);
} }
this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize()); this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize());
this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive()); this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive());
@ -251,7 +255,9 @@ public class JDBCDefPane extends JPanel {
} }
public JDBCDatabaseConnection update() { public JDBCDatabaseConnection update() {
JDBCDatabaseConnection jdbcDatabase = new JDBCDatabaseConnection(); if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection();
}
Object driveItem = this.driverComboBox.getSelectedItem(); Object driveItem = this.driverComboBox.getSelectedItem();
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString());
jdbcDatabase.setURL(this.urlTextField.getText().trim()); jdbcDatabase.setURL(this.urlTextField.getText().trim());

Loading…
Cancel
Save