diff options
author | Dave Cramer <davec@fastcrypt.com> | 2003-02-04 11:16:00 +0000 |
---|---|---|
committer | Dave Cramer <davec@fastcrypt.com> | 2003-02-04 11:16:00 +0000 |
commit | 62ca0fce8f95b1fd5a0cd85d3e3cf56a7fb7fa6f (patch) | |
tree | e3385e5c78f39560d11f6698d462ace414ff1b4d /src/interfaces/jdbc | |
parent | caa72ad57fbb60813c9934f7a42a44e7da426bd4 (diff) | |
download | postgresql-62ca0fce8f95b1fd5a0cd85d3e3cf56a7fb7fa6f.tar.gz postgresql-62ca0fce8f95b1fd5a0cd85d3e3cf56a7fb7fa6f.zip |
Fix for rollback SQLException from Kris Jurka
Diffstat (limited to 'src/interfaces/jdbc')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java b/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java index b4dcbaaf53e..e81c5afed3e 100644 --- a/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java +++ b/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java @@ -13,7 +13,7 @@ import org.postgresql.util.PSQLException; * <p>The lifetime of a QueryExecutor object is from sending the query * until the response has been received from the backend. * - * $Id: QueryExecutor.java,v 1.16.2.1 2002/11/14 05:54:39 barry Exp $ + * $Id: QueryExecutor.java,v 1.16.2.2 2003/02/04 11:16:00 davec Exp $ */ public class QueryExecutor @@ -139,13 +139,18 @@ public class QueryExecutor */ private void sendQuery() throws SQLException { + // check the binds before starting the query send process. + for (int i = 0 ; i < m_binds.length ; ++i) + { + if (m_binds[i] == null) + throw new PSQLException("postgresql.prep.param", new Integer(i + 1)); + } + try { pg_stream.SendChar('Q'); for (int i = 0 ; i < m_binds.length ; ++i) { - if (m_binds[i] == null) - throw new PSQLException("postgresql.prep.param", new Integer(i + 1)); pg_stream.Send(connection.getEncoding().encode(m_sqlFrags[i])); pg_stream.Send(connection.getEncoding().encode(m_binds[i].toString())); } |