Browse Source

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

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

9
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 ORACLE_DEFAULT_FETCHSIZE = 128;
private static final int DB2_DEFAULT_FETCHSIZE = 50; private static final int DB2_DEFAULT_FETCHSIZE = 50;
private static final int POSTGRE_DEFAULT_FETCHSIZE = 10000; private static final int POSTGRE_DEFAULT_FETCHSIZE = 10000;
private static final int EMPTY_FETCHSIZE = -2;
// carl:DBCP的一些属性 // carl:DBCP的一些属性
private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor(); private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor();
private IntegerEditor DBCP_MAX_ACTIVE = new IntegerEditor(); private IntegerEditor DBCP_MAX_ACTIVE = new IntegerEditor();
@ -125,9 +126,13 @@ public class DBCPAttrPane extends BasicPane {
this.DBCP_TIMEBETWEENEVICTIONRUNSMILLS.setValue(dbcpAttr.getTimeBetweenEvictionRunsMillis()); this.DBCP_TIMEBETWEENEVICTIONRUNSMILLS.setValue(dbcpAttr.getTimeBetweenEvictionRunsMillis());
Integer fetchSize = DEFAULT_FETCHSIZE_MAP.get(JDBCConnectionDef.getInstance().getDatabaseName()); Integer fetchSize = DEFAULT_FETCHSIZE_MAP.get(JDBCConnectionDef.getInstance().getDatabaseName());
if (fetchSize != null) { if (fetchSize != null) {
if (jdbcDatabase.getFetchSize() == EMPTY_FETCHSIZE) {
this.FETCHSIZE.setText(StringUtils.EMPTY);
} else {
this.FETCHSIZE.setText(jdbcDatabase.getFetchSize() == -1 ? String.valueOf(fetchSize) : String.valueOf(jdbcDatabase.getFetchSize())); this.FETCHSIZE.setText(jdbcDatabase.getFetchSize() == -1 ? String.valueOf(fetchSize) : String.valueOf(jdbcDatabase.getFetchSize()));
} }
} }
}
public void update(JDBCDatabaseConnection jdbcDatabase) { public void update(JDBCDatabaseConnection jdbcDatabase) {
DBCPConnectionPoolAttr dbcpAttr = jdbcDatabase.getDbcpAttr(); DBCPConnectionPoolAttr dbcpAttr = jdbcDatabase.getDbcpAttr();
@ -149,9 +154,13 @@ public class DBCPAttrPane extends BasicPane {
dbcpAttr.setTimeBetweenEvictionRunsMillis(((Number) this.DBCP_TIMEBETWEENEVICTIONRUNSMILLS.getValue()).intValue()); dbcpAttr.setTimeBetweenEvictionRunsMillis(((Number) this.DBCP_TIMEBETWEENEVICTIONRUNSMILLS.getValue()).intValue());
Integer fetchSize = DEFAULT_FETCHSIZE_MAP.get(JDBCConnectionDef.getInstance().getDatabaseName()); Integer fetchSize = DEFAULT_FETCHSIZE_MAP.get(JDBCConnectionDef.getInstance().getDatabaseName());
if (fetchSize != null) { if (fetchSize != null) {
if (StringUtils.isEmpty(this.FETCHSIZE.getText())) {
jdbcDatabase.setFetchSize(EMPTY_FETCHSIZE);
} else {
jdbcDatabase.setFetchSize(Integer.parseInt(this.FETCHSIZE.getText())); jdbcDatabase.setFetchSize(Integer.parseInt(this.FETCHSIZE.getText()));
} }
} }
}
@Override @Override
public BasicDialog showWindow(Window window) { public BasicDialog showWindow(Window window) {

Loading…
Cancel
Save