|
|
@ -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) { |
|
|
|