Browse Source

REPORT-54853 fetchsize为空时,数据连接点击确定无效

feature/10.0
Bruce.Deng 3 years ago
parent
commit
2446db1e27
  1. 13
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java

13
designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java

@ -42,6 +42,7 @@ public class DBCPAttrPane extends BasicPane {
private static final int ORACLE_DEFAULT_FETCHSIZE = 128;
private static final int DB2_DEFAULT_FETCHSIZE = 50;
private static final int POSTGRE_DEFAULT_FETCHSIZE = 10000;
private static final int EMPTY_FETCHSIZE = -2;
// carl:DBCP的一些属性
private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor();
private IntegerEditor DBCP_MAX_ACTIVE = new IntegerEditor();
@ -125,7 +126,11 @@ public class DBCPAttrPane extends BasicPane {
this.DBCP_TIMEBETWEENEVICTIONRUNSMILLS.setValue(dbcpAttr.getTimeBetweenEvictionRunsMillis());
Integer fetchSize = DEFAULT_FETCHSIZE_MAP.get(JDBCConnectionDef.getInstance().getDatabaseName());
if (fetchSize != null) {
this.FETCHSIZE.setText(jdbcDatabase.getFetchSize() == -1 ? String.valueOf(fetchSize) : String.valueOf(jdbcDatabase.getFetchSize()));
if (jdbcDatabase.getFetchSize() == EMPTY_FETCHSIZE) {
this.FETCHSIZE.setText(StringUtils.EMPTY);
} else {
this.FETCHSIZE.setText(jdbcDatabase.getFetchSize() == -1 ? String.valueOf(fetchSize) : String.valueOf(jdbcDatabase.getFetchSize()));
}
}
}
@ -149,7 +154,11 @@ public class DBCPAttrPane extends BasicPane {
dbcpAttr.setTimeBetweenEvictionRunsMillis(((Number) this.DBCP_TIMEBETWEENEVICTIONRUNSMILLS.getValue()).intValue());
Integer fetchSize = DEFAULT_FETCHSIZE_MAP.get(JDBCConnectionDef.getInstance().getDatabaseName());
if (fetchSize != null) {
jdbcDatabase.setFetchSize(Integer.parseInt(this.FETCHSIZE.getText()));
if (StringUtils.isEmpty(this.FETCHSIZE.getText())) {
jdbcDatabase.setFetchSize(EMPTY_FETCHSIZE);
} else {
jdbcDatabase.setFetchSize(Integer.parseInt(this.FETCHSIZE.getText()));
}
}
}

Loading…
Cancel
Save