? build.local.properties Index: org/postgresql/Driver.java.in =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/Driver.java.in,v retrieving revision 1.78 diff -u -r1.78 Driver.java.in --- org/postgresql/Driver.java.in 2 Jun 2009 00:22:58 -0000 1.78 +++ org/postgresql/Driver.java.in 8 Oct 2009 19:55:18 -0000 @@ -459,7 +459,11 @@ { "kerberosServerName", Boolean.FALSE, "The Kerberos service name to use when authenticating with GSSAPI. This is equivalent to libpq's PGKRBSRVNAME environment variable." }, { "jaasApplicationName", Boolean.FALSE, - "Specifies the name of the JAAS system or application login configuration." } + "Specifies the name of the JAAS system or application login configuration." }, + { "defaultFetchSize", Boolean.FALSE, + "Specifies an integer fetchSize to use as a default on all new Statement instances. A better approach is to modify the calling application to set an appropriate size - this parameter is for situations where this is not possible." }, + { "defaultAutoCommit", Boolean.FALSE, + "Sets the autocommit state for all new Connections." } }; /** Index: org/postgresql/jdbc2/AbstractJdbc2Connection.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java,v retrieving revision 1.52 diff -u -r1.52 AbstractJdbc2Connection.java --- org/postgresql/jdbc2/AbstractJdbc2Connection.java 1 Jul 2009 05:00:40 -0000 1.52 +++ org/postgresql/jdbc2/AbstractJdbc2Connection.java 8 Oct 2009 19:55:19 -0000 @@ -65,6 +65,7 @@ protected int prepareThreshold; // Connection's autocommit state. public boolean autoCommit = true; + public boolean defaultAutoCommit = true; // Connection's readonly state. public boolean readOnly = false; @@ -76,6 +77,9 @@ public abstract DatabaseMetaData getMetaData() throws SQLException; + //default fetch size for new statementinstances + public int defaultFetchSize = 0; + // // Ctor. // @@ -117,6 +121,31 @@ { } + //setup a default fetch size + try + { + this.defaultFetchSize = Integer.parseInt( info.getProperty( "defaultFetchSize", "0" ) ); + } + catch (NumberFormatException nfe) + { + logger.debug("defaultFetchSize property was not an integer"); + } + + //override default autocommit state + try + { + this.defaultAutoCommit = Boolean.parseBoolean( info.getProperty( "defaultAutoCommit", "true" ) ); + } + catch (Exception ace) + { + logger.debug("defaultAutoCommit property could not be parsed as a boolean"); + } + + if( this.defaultAutoCommit != this.autoCommit ) + { + setAutoCommit( this.defaultAutoCommit ); + } + //Print out the driver version number if (logger.logInfo()) logger.info(Driver.getVersion()); Index: org/postgresql/jdbc3/Jdbc3Connection.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc3/Jdbc3Connection.java,v retrieving revision 1.12 diff -u -r1.12 Jdbc3Connection.java --- org/postgresql/jdbc3/Jdbc3Connection.java 8 Jan 2008 06:56:29 -0000 1.12 +++ org/postgresql/jdbc3/Jdbc3Connection.java 8 Oct 2009 19:55:20 -0000 @@ -28,6 +28,7 @@ { Jdbc3Statement s = new Jdbc3Statement(this, resultSetType, resultSetConcurrency, resultSetHoldability); s.setPrepareThreshold(getPrepareThreshold()); + s.setFetchSize( this.defaultFetchSize ); return s; } @@ -36,6 +37,7 @@ { Jdbc3PreparedStatement s = new Jdbc3PreparedStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability); s.setPrepareThreshold(getPrepareThreshold()); + s.setFetchSize( this.defaultFetchSize ); return s; } Index: org/postgresql/jdbc3g/Jdbc3gConnection.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc3g/Jdbc3gConnection.java,v retrieving revision 1.6 diff -u -r1.6 Jdbc3gConnection.java --- org/postgresql/jdbc3g/Jdbc3gConnection.java 8 Oct 2008 18:24:05 -0000 1.6 +++ org/postgresql/jdbc3g/Jdbc3gConnection.java 8 Oct 2009 19:55:20 -0000 @@ -28,6 +28,7 @@ { Jdbc3gStatement s = new Jdbc3gStatement(this, resultSetType, resultSetConcurrency, resultSetHoldability); s.setPrepareThreshold(getPrepareThreshold()); + s.setFetchSize( this.defaultFetchSize ); return s; } @@ -36,6 +37,7 @@ { Jdbc3gPreparedStatement s = new Jdbc3gPreparedStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability); s.setPrepareThreshold(getPrepareThreshold()); + s.setFetchSize( this.defaultFetchSize ); return s; } Index: org/postgresql/jdbc4/Jdbc4Connection.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc4/Jdbc4Connection.java,v retrieving revision 1.2 diff -u -r1.2 Jdbc4Connection.java --- org/postgresql/jdbc4/Jdbc4Connection.java 8 Jan 2008 06:56:30 -0000 1.2 +++ org/postgresql/jdbc4/Jdbc4Connection.java 8 Oct 2009 19:55:20 -0000 @@ -28,6 +28,8 @@ { Jdbc4Statement s = new Jdbc4Statement(this, resultSetType, resultSetConcurrency, resultSetHoldability); s.setPrepareThreshold(getPrepareThreshold()); + s.setFetchSize( this.defaultFetchSize ); + return s; } @@ -36,6 +38,7 @@ { Jdbc4PreparedStatement s = new Jdbc4PreparedStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability); s.setPrepareThreshold(getPrepareThreshold()); + s.setFetchSize( this.defaultFetchSize ); return s; }