JDBC Driver - Batch Prepared Statements

From: Kris Jurka <jurka(at)ejurka(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: JDBC Driver - Batch Prepared Statements
Date: 2002-09-10 00:24:51
Message-ID: 3D7D3BD3.8070104@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


The code in AbstractJbc1Statement: execute(String sql) and
executeUpdate(sql) was setting m_sqlFragments while ignoring m_binds.
This caused Batch Prepared Statements to fail becuase while at one point
the statement had binds, executeBatch turned the PreparedStatement into
a plain String without removing the binds. I don't know why this wasn't
causing an IndexOutOfBoundsException in the QueryExecutor at or about
line 144, but this seems to fix it.

It seems like m_bindTypes, m_origSqlFragments, m_executeSqlFragments
might need to be reset as well, but this at least gets the regression
tests to pass.

Kris Jurka

Attachment Content-Type Size
batch-prepared-statements.patch text/plain 1.1 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-09-10 02:15:00 Re: cube and earthdistance diffs
Previous Message Bruno Wolff III 2002-09-09 23:15:32 Updated earthdistance/cube patches