diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 4bf6bf190..4d2003144 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/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_MINEVICTABLEIDLETIMEMILLIS = new IntegerEditor(); + private JDBCDatabaseConnection jdbcDatabase; + public JDBCDefPane() { this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":")); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); @@ -202,6 +204,7 @@ public class JDBCDefPane extends JPanel { if (jdbcDatabase == null) { jdbcDatabase = new JDBCDatabaseConnection(); } + this.jdbcDatabase = jdbcDatabase; if (ComparatorUtils.equals(jdbcDatabase.getDriver(), "sun.jdbc.odbc.JdbcOdbcDriver") && jdbcDatabase.getURL().startsWith("jdbc:odbc:Driver={Microsoft")) { this.dbtypeComboBox.setSelectedItem("Access"); @@ -235,6 +238,7 @@ public class JDBCDefPane extends JPanel { if (dbcpAttr == null) { dbcpAttr = new DBCPConnectionPoolAttr(); jdbcDatabase.setDbcpAttr(dbcpAttr); + this.jdbcDatabase.setDbcpAttr(dbcpAttr); } this.DBCP_INITIAL_SIZE.setValue(dbcpAttr.getInitialSize()); this.DBCP_MAX_ACTIVE.setValue(dbcpAttr.getMaxActive()); @@ -251,7 +255,9 @@ public class JDBCDefPane extends JPanel { } public JDBCDatabaseConnection update() { - JDBCDatabaseConnection jdbcDatabase = new JDBCDatabaseConnection(); + if (jdbcDatabase == null) { + jdbcDatabase = new JDBCDatabaseConnection(); + } Object driveItem = this.driverComboBox.getSelectedItem(); jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); jdbcDatabase.setURL(this.urlTextField.getText().trim());