package foam.dao.pg;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class IndexedPreparedStatement
{

  protected int index_;
  protected PreparedStatement delegate_;

  public IndexedPreparedStatement(PreparedStatement delegate) {
    this(1, delegate);
  }

  public IndexedPreparedStatement(int index, PreparedStatement delegate) {
    this.index_ = index;
    this.delegate_ = delegate;
  }

  public void setDelegate_(PreparedStatement delegate_) {
    this.delegate_ = delegate_;
  }

  public void close() throws SQLException {
    delegate_.close();
  }

  public ResultSet executeQuery() throws SQLException {
    return delegate_.executeQuery();
  }

  public int executeUpdate() throws SQLException {
    return delegate_.executeUpdate();
  }

  public ResultSet getGeneratedKeys() throws SQLException {
    return delegate_.getGeneratedKeys();
  }

  public void setLong(long x) throws SQLException {
    delegate_.setLong(index_++, x);
  }

  public void setObject(Object x) throws SQLException {
    delegate_.setObject(index_++, x);
  }
}
@@ -1098,10 +1098,143 @@
  x);%0A  %7D
+%0A%0A  public void setObject(Object x, int targetSqlType) throws SQLException %7B%0A    delegate_.setObject(index_++, x, targetSqlType);%0A  %7D
 %0A%7D

add setObject(Object, int) method in IndexedPreparedStatement class