Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 985e551

Browse files
author
Dave Cramer
committed
Applied Kris Jurkas patch to fix rollback and SQLException
1 parent d23fd95 commit 985e551

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* <p>The lifetime of a QueryExecutor object is from sending the query
1717
* until the response has been received from the backend.
1818
*
19-
* $Id: QueryExecutor.java,v 1.18 2003/02/04 09:20:08 barry Exp $
19+
* $Id: QueryExecutor.java,v 1.19 2003/02/04 11:01:52 davec Exp $
2020
*/
2121

2222
public class QueryExecutor
@@ -189,14 +189,16 @@ private java.sql.ResultSet execute() throws SQLException
189189
*/
190190
private void sendQuery() throws SQLException
191191
{
192+
for ( int i = 0; i < m_binds.length ; i++ )
193+
{
194+
if ( m_binds[i] == null )
195+
throw new PSQLException("postgresql.prep.param", new Integer(i + 1));
196+
}
192197
try
193198
{
194199
pg_stream.SendChar('Q');
195200
for (int i = 0 ; i < m_binds.length ; ++i)
196201
{
197-
if (m_binds[i] == null)
198-
throw new PSQLException("postgresql.prep.param (" + i + ")", new Integer(i + 1));
199-
200202
pg_stream.Send(connection.getEncoding().encode(m_sqlFrags[i]));
201203
pg_stream.Send(connection.getEncoding().encode(m_binds[i].toString()));
202204
}

0 commit comments

Comments
 (0)