@ -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,7 +126,11 @@ 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 ) {
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 ( ) ) ;
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 ) {
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 ( ) ) ) ;
}
}
}
}
}