Index: org/postgresql/core/BaseConnection.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/core/BaseConnection.java,v
retrieving revision 1.5
diff -c -r1.5 BaseConnection.java
*** org/postgresql/core/BaseConnection.java	29 Nov 2003 19:52:09 -0000	1.5
--- org/postgresql/core/BaseConnection.java	15 Feb 2004 16:14:28 -0000
***************
*** 20,25 ****
--- 20,28 ----
  
  public interface BaseConnection extends PGConnection
  {
+     public static final char TRANSACTION_IDLE = 'I';
+     public static final char TRANSACTION_IN_PROGRESS = 'T';
+     public static final char TRANSACTION_ERROR = 'E';
  
  	public void addNotification(PGNotification p_notification);
  	public void addWarning(String msg);
***************
*** 42,47 ****
  	public boolean haveMinimumServerVersion(String ver) throws SQLException;
  	public void setAutoCommit(boolean autoCommit) throws SQLException;
  	public void setCursorName(String cursor) throws SQLException;
  
  }
- 
--- 45,52 ----
  	public boolean haveMinimumServerVersion(String ver) throws SQLException;
  	public void setAutoCommit(boolean autoCommit) throws SQLException;
  	public void setCursorName(String cursor) throws SQLException;
+ 	public char getTransactionState();
+ 	public void setTransactionState(char c);
+ 	public QueryExecutor getQueryExecutor();
  
  }
Index: org/postgresql/core/QueryExecutor.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/core/QueryExecutor.java,v
retrieving revision 1.30
diff -c -r1.30 QueryExecutor.java
*** org/postgresql/core/QueryExecutor.java	28 Jan 2004 12:16:09 -0000	1.30
--- org/postgresql/core/QueryExecutor.java	15 Feb 2004 16:14:30 -0000
***************
*** 21,109 ****
  
  public class QueryExecutor
  {
  	//This version of execute does not take an existing result set, but 
!     //creates a new one for the results of the query
! 	public static BaseResultSet execute(String[] p_sqlFrags,
! 				    Object[] p_binds,
! 				    BaseStatement statement)
! 	throws SQLException
! 	{
! 		QueryExecutor qe = new QueryExecutor();
! 		qe.m_sqlFrags = p_sqlFrags;
! 		qe.m_binds = p_binds;
! 		qe.statement = statement;
  		if (statement != null)
! 			qe.maxRows = statement.getMaxRows();
  		else
! 			qe.maxRows = 0;
  
!         qe.connection = statement.getPGConnection();
! 		qe.pgStream = qe.connection.getPGStream();
  
! 		return qe.execute();
  	}
  
  	//This version of execute reuses an existing result set for the query 
      //results, this is used when a result set is backed by a cursor and 
  	//more results are fetched
! 	public static void execute(String[] p_sqlFrags,
! 				    Object[] p_binds,
! 				    BaseResultSet rs)
! 	throws SQLException
! 	{
! 		QueryExecutor qe = new QueryExecutor();
! 		qe.m_sqlFrags = p_sqlFrags;
! 		qe.m_binds = p_binds;
! 		qe.rs = rs;
! 		qe.statement = qe.rs.getPGStatement();
! 		if (qe.statement != null)
! 			qe.maxRows = qe.statement.getMaxRows();
  		else
! 			qe.maxRows = 0;
  
!         qe.connection = qe.statement.getPGConnection();
! 		qe.pgStream = 	qe.connection.getPGStream();
  
! 		qe.execute();
  	}
  
! 
! 	private QueryExecutor ()
  	{
! 	}
  
!    	private String[] m_sqlFrags;
! 	private Object[] m_binds;
! 	private BaseStatement statement;
! 	private BaseResultSet rs;
  
!    	private BaseConnection connection;
!    	private PGStream pgStream;
  
! 	private Field[] fields = null;
! 	private Vector tuples = new Vector();
! 	private boolean binaryCursor = false;
! 	private String status = null;
! 	private int update_count = 1;
! 	private long insert_oid = 0;
! 	private int maxRows;
  
  
  	/*
  	 * Execute a query on the backend.
  	 *
  	 */
! 	private BaseResultSet execute() throws SQLException
  	{
  		if (connection.getPGProtocolVersionMajor() == 3) {
  			if (Driver.logDebug)
  				Driver.debug("Using Protocol Version3 to send query");
! 			return executeV3();
  		} else {
  			if (Driver.logDebug)
  				Driver.debug("Using Protocol Version2 to send query");
! 			return executeV2();
  		}
  	}
  
  	private BaseResultSet executeV3() throws SQLException
--- 21,203 ----
  
  public class QueryExecutor
  {
+ 	public QueryExecutor ()
+ 	{
+ 	}
+ 
+    	private String[] m_sqlFrags;
+ 	private Object[] m_binds;
+ 	private BaseStatement statement;
+ 	private BaseResultSet rs;
+ 
+    	private BaseConnection connection;
+    	private PGStream pgStream;
+ 
+ 	private Field[] fields = null;
+ 	private Vector tuples = new Vector();
+ 	private boolean binaryCursor = false;
+ 	private String status = null;
+ 	private int update_count = 1;
+ 	private long insert_oid = 0;
+ 	private int maxRows;
+ 
  	//This version of execute does not take an existing result set, but 
! 	//creates a new one for the results of the query
! 	public synchronized BaseResultSet execute(
! 		String[] p_sqlFrags, Object[] p_binds, BaseStatement statement)
! 		throws SQLException
! 	{
! 		BaseConnection connection = statement.getPGConnection();
! 
! 		/*
! 		 * If the connection is not in auto-commit mode and there's not
! 		 * already a transaction, then a new transaction needs to be
! 		 * started.
! 		 */
! 		if (!connection.getAutoCommit()
! 			&& (connection.getTransactionState() == BaseConnection.TRANSACTION_IDLE))
! 		{
! 			executeInternal("begin", statement);
! 		}
! 
! 		this.m_sqlFrags = p_sqlFrags;
! 		this.m_binds = p_binds;
! 		this.statement = statement;
  		if (statement != null)
! 			this.maxRows = statement.getMaxRows();
  		else
! 			this.maxRows = 0;
  
! 		this.rs = null;
! 		this.connection = connection;
! 		this.pgStream = connection.getPGStream();
  
! 		return executeMain();
  	}
  
  	//This version of execute reuses an existing result set for the query 
      //results, this is used when a result set is backed by a cursor and 
  	//more results are fetched
! 	public synchronized void execute(
! 		String[] p_sqlFrags, Object[] p_binds, BaseResultSet rs)
! 		throws SQLException
! 	{
! 		//
! 		// Because this method is only used for fetching results of
! 		// previous ResultSet objects, it just shouldn't matter if it
! 		// "accidentally" happens outside a transaction.  As a result,
! 		// the check for an existing transaction is omitted.
! 		//
! 
! 		this.m_sqlFrags = p_sqlFrags;
! 		this.m_binds = p_binds;
! 		this.rs = rs;
! 		this.statement = rs.getPGStatement();
! 		if (statement != null)
! 			this.maxRows = statement.getMaxRows();
  		else
! 			this.maxRows = 0;
  
!         this.connection = statement.getPGConnection();
! 		this.pgStream = connection.getPGStream();
  
! 		executeMain();
  	}
  
! 	// This version of execute is used internally by QueryExecutor to
! 	// issue transaction-related commands.
! 	protected synchronized BaseResultSet executeInternal(
! 		String query, BaseStatement statement)
! 		throws SQLException
  	{
! 		BaseConnection connection = statement.getPGConnection();
  
! 		this.m_sqlFrags = new String[] { query };
! 		this.m_binds = new Object[0];
  
! 		this.statement = statement;
! 		this.maxRows = 0;
  
!         this.connection = statement.getPGConnection();
! 		this.pgStream = connection.getPGStream();
  
+ 		return executeMain();
+ 	}
  
  	/*
  	 * Execute a query on the backend.
  	 *
  	 */
! 	private BaseResultSet executeMain() throws SQLException
  	{
+ 		/*
+ 		 * Initialize fields that hold temporary data for the query.
+ 		 */
+ 		fields = null;
+ 		tuples = new Vector();
+ 		binaryCursor = false;
+ 		status = null;
+ 		update_count = 1;
+ 		insert_oid = 0;
+ 
+ 		BaseResultSet result;
+ 
  		if (connection.getPGProtocolVersionMajor() == 3) {
  			if (Driver.logDebug)
  				Driver.debug("Using Protocol Version3 to send query");
! 			result = executeV3();
  		} else {
  			if (Driver.logDebug)
  				Driver.debug("Using Protocol Version2 to send query");
! 			result = executeV2();
! 		}
! 
! 		if (connection.getPGProtocolVersionMajor() < 3)
! 		{
! 			if ((m_sqlFrags.length > 0)
! 				&& (m_sqlFrags[0].trim().toLowerCase().startsWith("begin")))
! 			{
! 				connection.setTransactionState(
! 					BaseConnection.TRANSACTION_IN_PROGRESS);
! 			}
! 
! 			if ((m_sqlFrags.length > 0)
! 				&& (m_sqlFrags[0].trim().toLowerCase().startsWith("start transaction")))
! 			{
! 				connection.setTransactionState(
! 					BaseConnection.TRANSACTION_IN_PROGRESS);
! 			}
! 
! 			if ((m_sqlFrags.length > 0)
! 				&& (m_sqlFrags[0].trim().toLowerCase().startsWith("commit")))
! 			{
! 				connection.setTransactionState(
! 					BaseConnection.TRANSACTION_IDLE);
! 			}
! 
! 			if ((m_sqlFrags.length > 0)
! 				&& (m_sqlFrags[0].trim().toLowerCase().startsWith("end")))
! 			{
! 				connection.setTransactionState(
! 					BaseConnection.TRANSACTION_IDLE);
! 			}
! 
! 			if ((m_sqlFrags.length > 0)
! 				&& (m_sqlFrags[0].trim().toLowerCase().startsWith("rollback")))
! 			{
! 				connection.setTransactionState(
! 					BaseConnection.TRANSACTION_IDLE);
! 			}
! 
! 			if ((m_sqlFrags.length > 0)
! 				&& (m_sqlFrags[0].trim().toLowerCase().startsWith("abort")))
! 			{
! 				connection.setTransactionState(
! 					BaseConnection.TRANSACTION_IDLE);
! 			}
  		}
+ 
+ 		return result;
  	}
  
  	private BaseResultSet executeV3() throws SQLException
***************
*** 187,194 ****
  						// read ReadyForQuery
  						//TODO: use size better
  						if (pgStream.ReceiveIntegerR(4) != 5) throw new PSQLException("postgresql.con.setup", PSQLState.CONNECTION_UNABLE_TO_CONNECT); 
! 						//TODO: handle transaction status
  						char l_tStatus = (char)pgStream.ReceiveChar();
  						l_endQuery = true;
  						break;
  					default:
--- 281,290 ----
  						// read ReadyForQuery
  						//TODO: use size better
  						if (pgStream.ReceiveIntegerR(4) != 5) throw new PSQLException("postgresql.con.setup", PSQLState.CONNECTION_UNABLE_TO_CONNECT); 
! 
  						char l_tStatus = (char)pgStream.ReceiveChar();
+ 						connection.setTransactionState(l_tStatus);
+ 
  						l_endQuery = true;
  						break;
  					default:
Index: org/postgresql/jdbc1/AbstractJdbc1Connection.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java,v
retrieving revision 1.34
diff -c -r1.34 AbstractJdbc1Connection.java
*** org/postgresql/jdbc1/AbstractJdbc1Connection.java	14 Feb 2004 12:03:09 -0000	1.34
--- org/postgresql/jdbc1/AbstractJdbc1Connection.java	15 Feb 2004 16:14:30 -0000
***************
*** 46,51 ****
--- 46,53 ----
  		return pgStream;
  	}
  
+ 	private QueryExecutor queryExecutor;
+ 
  	protected String PG_HOST;
  	protected int PG_PORT;
  	protected String PG_USER;
***************
*** 73,78 ****
--- 75,87 ----
  	public boolean autoCommit = true;
  	public boolean readOnly = false;
  
+     /*
+      * The current transaction state.  If the v3 protocol is used, we
+      * get this directly from the database.  If the v2 protocol is
+      * used, we'll try to keep track of what's going on.
+      */
+     private char transactionState;
+ 
  	public Driver this_driver;
  	private String this_url;
  	private String cursor = null;	// The positioned update cursor name
***************
*** 490,498 ****
  
  		// read ReadyForQuery
  		if (pgStream.ReceiveIntegerR(4) != 5) throw new PSQLException("postgresql.con.setup", PSQLState.CONNECTION_UNABLE_TO_CONNECT);
  
! 		//TODO: handle transaction status
! 		char l_tStatus = (char)pgStream.ReceiveChar();
  
  		// Initialise object handling
  		initObjectTypes();
--- 499,517 ----
  
  		// read ReadyForQuery
  		if (pgStream.ReceiveIntegerR(4) != 5) throw new PSQLException("postgresql.con.setup", PSQLState.CONNECTION_UNABLE_TO_CONNECT);
+ 		transactionState = (char)pgStream.ReceiveChar();
+ 
+ 		if (transactionState != TRANSACTION_IDLE)
+ 		{
+ 			/*
+ 			 * As best I (Chris Smith, <cdsmith@twu.net>) can figure, this
+ 			 * should always report the transaction as idle.  This
+ 			 * exception is here so that I'll find out if I'm wrong.
+ 			 */
+ 			throw new PSQLException("postgresql.unusual", PSQLState.UNEXPECTED_ERROR);
+ 		}
  
! 		queryExecutor = new QueryExecutor();
  
  		// Initialise object handling
  		initObjectTypes();
***************
*** 722,727 ****
--- 741,752 ----
  			}
  		}
  		while (beresp == 'N');
+ 
+ 		// The transaction should be considered idle from here out.
+ 		transactionState = TRANSACTION_IDLE;
+ 
+ 		queryExecutor = new QueryExecutor();
+ 
  		// "pg_encoding_to_char(1)" will return 'EUC_JP' for a backend compiled with multibyte,
  		// otherwise it's hardcoded to 'SQL_ASCII'.
  		// If the backend doesn't know about multibyte we can't assume anything about the encoding
***************
*** 755,761 ****
  		String dbEncoding = resultSet.getString(2);
  		encoding = Encoding.getEncoding(dbEncoding, info.getProperty("charSet"));
  
- 		//TODO: remove this once the set is done as part of V3protocol connection initiation
  		if (haveMinimumServerVersion("7.4"))
  		{
  			BaseResultSet acRset =
--- 780,785 ----
***************
*** 785,790 ****
--- 809,815 ----
  			{
  				throw new PSQLException("postgresql.con.failed.bad.autocommit", PSQLState.CONNECTION_UNABLE_TO_CONNECT);
  			}
+ 
  			//if autocommit is currently off we need to turn it on
  			//note that we will be in a transaction because the select above
  			//will have initiated the transaction so we need a commit
***************
*** 795,800 ****
--- 820,829 ----
  			}
  		}
  
+ 		// Things are now set up so that there's always an idle transaction
+ 		// at this point.
+ 		transactionState = TRANSACTION_IDLE;
+ 
  		// Initialise object handling
  		initObjectTypes();
  
***************
*** 846,852 ****
  	{
  		final Object[] nullarr = new Object[0];
  		BaseStatement stat = (BaseStatement) createStatement();
! 		return QueryExecutor.execute(new String[] { s },
  									 nullarr,
  									 stat);
  	}
--- 875,881 ----
  	{
  		final Object[] nullarr = new Object[0];
  		BaseStatement stat = (BaseStatement) createStatement();
! 		return queryExecutor.execute(new String[] { s },
  									 nullarr,
  									 stat);
  	}
***************
*** 928,934 ****
  	 * <p><pre>
  	 * import org.postgresql.fastpath.*;
  	 * ...
! 	 * Fastpath fp = ((org.postgresql.Connection)myconn).getFastpathAPI();
  	 * </pre>
  	 *
  	 * <p>where myconn is an open Connection to org.postgresql.
--- 957,963 ----
  	 * <p><pre>
  	 * import org.postgresql.fastpath.*;
  	 * ...
! 	 * Fastpath fp = ((org.postgresql.PGConnection)myconn).getFastpathAPI();
  	 * </pre>
  	 *
  	 * <p>where myconn is an open Connection to org.postgresql.
***************
*** 958,964 ****
  	 * <p><pre>
  	 * import org.postgresql.largeobject.*;
  	 * ...
! 	 * LargeObjectManager lo = ((org.postgresql.Connection)myconn).getLargeObjectAPI();
  	 * </pre>
  	 *
  	 * <p>where myconn is an open Connection to org.postgresql.
--- 987,993 ----
  	 * <p><pre>
  	 * import org.postgresql.largeobject.*;
  	 * ...
! 	 * LargeObjectManager lo = ((org.postgresql.PGConnection)myconn).getLargeObjectAPI();
  	 * </pre>
  	 *
  	 * <p>where myconn is an open Connection to org.postgresql.
***************
*** 1043,1049 ****
  	 *
  	 * <p><pre>
  	 * ...
! 	 * ((org.postgresql.Connection)myconn).addDataType("mytype","my.class.name");
  	 * ...
  	 * </pre>
  	 *
--- 1072,1078 ----
  	 *
  	 * <p><pre>
  	 * ...
! 	 * ((org.postgresql.PGConnection)myconn).addDataType("mytype","my.class.name");
  	 * ...
  	 * </pre>
  	 *
***************
*** 1238,1257 ****
  			return ;
  		if (autoCommit)
  		{
! 				execSQL("end");
! 		}
! 		else
! 		{
! 			if (haveMinimumServerVersion("7.1"))
! 			{
! 				execSQL("begin;");
! 			}
! 			else
! 			{
! 				execSQL("begin");
! 				execSQL(getPre71IsolationLevelSQL(isolationLevel));
! 			}
  		}
  		this.autoCommit = autoCommit;
  	}
  
--- 1267,1275 ----
  			return ;
  		if (autoCommit)
  		{
! 			execSQL("end");
  		}
+ 
  		this.autoCommit = autoCommit;
  	}
  
***************
*** 1278,1296 ****
  	 */
  	public void commit() throws SQLException
  	{
! 		if (autoCommit)
! 			return ;
! 		//TODO: delay starting new transaction until first command
! 		if (haveMinimumServerVersion("7.1"))
! 		{
! 			execSQL("commit;begin;");
! 		}
! 		else
! 		{
! 			execSQL("commit");
! 			execSQL("begin");
! 			execSQL(getPre71IsolationLevelSQL(isolationLevel));
! 		}
  	}
  
  	/*
--- 1296,1303 ----
  	 */
  	public void commit() throws SQLException
  	{
! 		if (autoCommit) return;
! 		execSQL("commit");
  	}
  
  	/*
***************
*** 1303,1321 ****
  	 */
  	public void rollback() throws SQLException
  	{
! 		if (autoCommit)
! 			return ;
! 		//TODO: delay starting transaction until first command
! 		if (haveMinimumServerVersion("7.1"))
! 		{
! 			execSQL("rollback; begin;");
! 		}
! 		else
! 		{
! 			execSQL("rollback");
! 			execSQL("begin");
! 			execSQL(getPre71IsolationLevelSQL(isolationLevel));
! 		}
  	}
  
  	/*
--- 1310,1317 ----
  	 */
  	public void rollback() throws SQLException
  	{
! 		if (autoCommit) return;
! 		execSQL("rollback");
  	}
  
  	/*
***************
*** 1345,1350 ****
--- 1341,1347 ----
  			l_rs.close();
  			l_stat.close();
  		}
+ 
  		if (level != null) {
  			level = level.toUpperCase();
  			if (level.indexOf("READ COMMITTED") != -1)
***************
*** 1374,1396 ****
  	 */
  	public void setTransactionIsolation(int level) throws SQLException
  	{
! 		//In 7.1 and later versions of the server it is possible using
! 		//the "set session" command to set this once for all future txns
! 		//however in 7.0 and prior versions it is necessary to set it in
! 		//each transaction, thus adding complexity below.
! 		//When we decide to drop support for servers older than 7.1
! 		//this can be simplified
! 		String isolationLevelSQL;
! 
! 		if (!haveMinimumServerVersion("7.1"))
! 		{
! 			isolationLevelSQL = getPre71IsolationLevelSQL(level);
! 		}
! 		else
! 		{
! 			isolationLevelSQL = "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " + getIsolationLevelName(level);
! 		}
! 		execSQL(isolationLevelSQL);
  		isolationLevel = level;
  	}
  
--- 1371,1377 ----
  	 */
  	public void setTransactionIsolation(int level) throws SQLException
  	{
! 		execSQL("SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL " + getIsolationLevelName(level));
  		isolationLevel = level;
  	}
  
***************
*** 1411,1430 ****
  	}
  
  	/*
- 	 * Helper method used by setTransactionIsolation(), commit(), rollback()
- 	 * and setAutoCommit(). This returns the SQL string needed to
- 	 * set the isolation level for a transaction.  In 7.1 and later it
- 	 * is possible to set a default isolation level that applies to all
- 	 * future transactions, this method is only necesary for 7.0 and older
- 	 * servers, and should be removed when support for these older
- 	 * servers are dropped
- 	 */
- 	protected String getPre71IsolationLevelSQL(int level) throws SQLException
- 	{
- 		return "SET TRANSACTION ISOLATION LEVEL " + getIsolationLevelName(level);
- 	}
- 
- 	/*
  	 * A sub-space of this Connection's database may be selected by
  	 * setting a catalog name.	If the driver does not support catalogs,
  	 * it will silently ignore this request
--- 1392,1397 ----
***************
*** 1810,1815 ****
  		m_notifications = null;
  		return l_return;
  	}
- }
  
  
--- 1777,1814 ----
  		m_notifications = null;
  		return l_return;
  	}
  
+ 	/*
+ 	 * Returns the current transaction state, which is one of:
+ 	 * 
+ 	 *     TRANSACTION_IDLE: No transaction in progress
+ 	 *     TRANSACTION_IN_PROGRESS: A transaction is in progress
+ 	 *     TRANSACTION_ERROR: An error has occurred in the transaction
+ 	 * 
+ 	 * In the v2 protocol, this returns a best guess as to the current
+ 	 * transaction state, but the guess should not be considered 100%
+ 	 * reliable.
+ 	 */
+ 	public char getTransactionState()
+ 	{
+ 		return transactionState;
+ 	}
+ 
+ 	/*
+ 	 * Sets the current transaction state.  This method should be called
+ 	 * by a method that has knowledge of a change in the state of the
+ 	 * transaction.  As a rule, in the v3 protocol, this would be only
+ 	 * called by code that receives a ReadyForQuery message; in the
+ 	 * v2 protocol, it is called by code that is aware of a change in the
+ 	 * transaction state for any reason.
+ 	 */
+ 	public void setTransactionState(char c)
+ 	{
+ 		this.transactionState = c;
+ 	}
  
+ 	public QueryExecutor getQueryExecutor()
+ 	{
+ 		return queryExecutor;
+ 	}
+ }
Index: org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java,v
retrieving revision 1.27
diff -c -r1.27 AbstractJdbc1ResultSet.java
*** org/postgresql/jdbc1/AbstractJdbc1ResultSet.java	11 Feb 2004 04:36:08 -0000	1.27
--- org/postgresql/jdbc1/AbstractJdbc1ResultSet.java	15 Feb 2004 16:14:30 -0000
***************
*** 158,166 ****
   				("FETCH FORWARD " + fetchSize + " FROM " + cursorName)
   			};
  
!   			QueryExecutor.execute(sql,
!  								  new String[0],
!   								  this);
  
    			// Test the new rows array.
   			lastFetchSize = fetchSize;
--- 158,165 ----
   				("FETCH FORWARD " + fetchSize + " FROM " + cursorName)
   			};
  
!   			connection.getQueryExecutor().execute(
!   				sql, new String[0], this);
  
    			// Test the new rows array.
   			lastFetchSize = fetchSize;
Index: org/postgresql/jdbc1/AbstractJdbc1Statement.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v
retrieving revision 1.48
diff -c -r1.48 AbstractJdbc1Statement.java
*** org/postgresql/jdbc1/AbstractJdbc1Statement.java	12 Feb 2004 19:10:35 -0000	1.48
--- org/postgresql/jdbc1/AbstractJdbc1Statement.java	15 Feb 2004 16:14:31 -0000
***************
*** 531,539 ****
  		String[] fragments = getQueryFragments();
  
  		// New in 7.1, pass Statement so that ExecSQL can customise to it
! 		result = QueryExecutor.execute(fragments,
! 									   m_binds,
! 									   this);
  
  		//If we are executing a callable statement function set the return data
  		if (isFunction)
--- 531,538 ----
  		String[] fragments = getQueryFragments();
  
  		// New in 7.1, pass Statement so that ExecSQL can customise to it
! 		result = connection.getQueryExecutor().execute(
! 			fragments, m_binds, this);
  
  		//If we are executing a callable statement function set the return data
  		if (isFunction)
Index: org/postgresql/jdbc3/Jdbc3RefCursorResultSet.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc3/Jdbc3RefCursorResultSet.java,v
retrieving revision 1.2
diff -c -r1.2 Jdbc3RefCursorResultSet.java
*** org/postgresql/jdbc3/Jdbc3RefCursorResultSet.java	29 May 2003 04:39:50 -0000	1.2
--- org/postgresql/jdbc3/Jdbc3RefCursorResultSet.java	15 Feb 2004 16:14:33 -0000
***************
*** 39,45 ****
  			return super.next();
  		// Initialize this res set with the rows from the cursor.
  		String[] toExec = { "FETCH ALL IN \"" + refCursorHandle + "\";" };
!                 QueryExecutor.execute(toExec, new String[0], this);
  		isInitialized = true;
  		return super.next();
  	}
--- 39,46 ----
  			return super.next();
  		// Initialize this res set with the rows from the cursor.
  		String[] toExec = { "FETCH ALL IN \"" + refCursorHandle + "\";" };
! 		getPGStatement().getPGConnection().getQueryExecutor()
! 			.execute(toExec, new String[0], this);
  		isInitialized = true;
  		return super.next();
  	}
