diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java index 3580257..0c6fbdd 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java +++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java @@ -39,7 +39,7 @@ import org.postgresql.util.GT; public abstract class AbstractJdbc2Statement implements BaseStatement { // only for testing purposes. even single shot statements will use binary transfers - public static boolean ForceBinaryTransfers = Boolean.getBoolean("org.postgresql.forcebinary"); + public boolean forceBinaryTransfers = false; protected ArrayList batchStatements = null; protected ArrayList batchParameters = null; @@ -145,7 +145,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement this.preparedQuery = null; this.preparedParameters = null; this.lastSimpleQuery = null; - ForceBinaryTransfers |= c.getForceBinary(); + forceBinaryTransfers |= c.getForceBinary(); resultsettype = rsType; concurrency = rsConcurrency; } @@ -166,7 +166,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement this.testReturn = new int[inParamCount]; this.functionReturnType = new int[inParamCount]; - ForceBinaryTransfers |= connection.getForceBinary(); + forceBinaryTransfers |= connection.getForceBinary(); resultsettype = rsType; concurrency = rsConcurrency; @@ -261,7 +261,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); - if (ForceBinaryTransfers) { + if (forceBinaryTransfers) { clearWarnings(); // Close any existing resultsets associated with this statement. while (firstUnclosedResult != null) @@ -532,7 +532,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement if (preparedQuery != null) { ++m_useCount; // We used this statement once more. - if ((m_prepareThreshold == 0 || m_useCount < m_prepareThreshold) && !ForceBinaryTransfers) + if ((m_prepareThreshold == 0 || m_useCount < m_prepareThreshold) && !forceBinaryTransfers) flags |= QueryExecutor.QUERY_ONESHOT; } @@ -543,7 +543,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement if (concurrency != ResultSet.CONCUR_READ_ONLY) flags |= QueryExecutor.QUERY_NO_BINARY_TRANSFER; - if (!queryToExecute.isStatementDescribed() && ForceBinaryTransfers) { + if (!queryToExecute.isStatementDescribed() && forceBinaryTransfers) { int flags2 = flags | QueryExecutor.QUERY_DESCRIBE_ONLY; StatementResultHandler handler2 = new StatementResultHandler(); connection.getQueryExecutor().execute(queryToExecute, queryParameters, handler2, 0, 0, flags2); @@ -2607,11 +2607,11 @@ public abstract class AbstractJdbc2Statement implements BaseStatement checkClosed(); if (newThreshold < 0) { - ForceBinaryTransfers = true; + forceBinaryTransfers = true; newThreshold = 1; } else - ForceBinaryTransfers = false; + forceBinaryTransfers = false; this.m_prepareThreshold = newThreshold; } @@ -2868,7 +2868,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement if (connection.getAutoCommit()) flags |= QueryExecutor.QUERY_SUPPRESS_BEGIN; - if (preDescribe || ForceBinaryTransfers) { + if (preDescribe || forceBinaryTransfers) { int flags2 = flags | QueryExecutor.QUERY_DESCRIBE_ONLY; StatementResultHandler handler2 = new StatementResultHandler(); connection.getQueryExecutor().execute(queries[0], parameterLists[0], handler2, 0, 0, flags2); diff --git a/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java b/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java index fddd10a..1961e8c 100644 --- a/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java +++ b/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java @@ -94,7 +94,7 @@ public class ServerPreparedStmtTest extends TestCase rs.close(); //Verify that using the statement still works after turning off prepares - if (AbstractJdbc2Statement.ForceBinaryTransfers) { + if (((AbstractJdbc2Statement)pstmt).forceBinaryTransfers) { return; } ((PGStatement)pstmt).setUseServerPrepare(false); @@ -128,7 +128,7 @@ public class ServerPreparedStmtTest extends TestCase rs.close(); //Verify that using the statement still works after turning off prepares - if (AbstractJdbc2Statement.ForceBinaryTransfers) { + if (((AbstractJdbc2Statement)pstmt).forceBinaryTransfers) { return; }