From 2446db1e27359f62fd45c9dfa6a1585c16cedb9f Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Mon, 12 Jul 2021 20:02:02 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-54853=20fetchsize=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A1=AE=E5=AE=9A=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/connect/DBCPAttrPane.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java index 58a021812..f65b6dc12 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java +++ b/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())); + } } }