Browse Source

KEPORT-107337 fix: 魔法值改一下

feature/x
Cloud.Liu 1 year ago
parent
commit
287710820d
  1. 7
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java

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

@ -45,6 +45,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 INVALID_FETCHSIZE = -1;
// carl:DBCP的一些属性
private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor();
private IntegerEditor DBCP_MIN_IDLE = new IntegerEditor();
@ -133,7 +134,7 @@ public class DBCPAttrPane extends BasicPane {
if (DEFAULT_FETCHSIZE_MAP.containsKey(databaseName)) {
this.FETCHSIZE.setText(String.valueOf(DEFAULT_FETCHSIZE_MAP.get(databaseName)));
} else {
this.FETCHSIZE.setText(String.valueOf(-1));
this.FETCHSIZE.setText(String.valueOf(INVALID_FETCHSIZE));
}
}
}
@ -171,14 +172,14 @@ public class DBCPAttrPane extends BasicPane {
if (DEFAULT_FETCHSIZE_MAP.containsKey(databaseName)) {
Optional.ofNullable(DEFAULT_FETCHSIZE_MAP.get(databaseName)).ifPresent(jdbcDatabase::setFetchSize);
} else {
jdbcDatabase.setFetchSize(-1);
jdbcDatabase.setFetchSize(INVALID_FETCHSIZE);
}
} else {
int fetchSizeSet = Integer.parseInt(fetchSizeText);
if (DialectFactory.isValidFetchSize(fetchSizeSet)) {
jdbcDatabase.setFetchSize(fetchSizeSet);
} else {
jdbcDatabase.setFetchSize(-1);
jdbcDatabase.setFetchSize(INVALID_FETCHSIZE);
}
}
}

Loading…
Cancel
Save