/**
   * Create a parameter object for an update, delete or insert statement.
   *
   * @param pos the substitution position of the parameter marker in the SQL
   * @param info the ColInfo column descriptor
   * @param value the column data item
   * @return The new parameter as a <code>ParamInfo</code> object.
   */
  protected ParamInfo buildParameter(int pos, ColInfo info, Object value) throws SQLException {

    int length = 0;
    if (value instanceof String) {
      length = ((String) value).length();
    } else if (value instanceof byte[]) {
      length = ((byte[]) value).length;
    } else if (value instanceof BlobImpl) {
      BlobImpl blob = (BlobImpl) value;
      value = blob.getBinaryStream();
      length = (int) blob.length();
    } else if (value instanceof ClobImpl) {
      ClobImpl clob = (ClobImpl) value;
      value = clob.getCharacterStream();
      length = (int) clob.length();
    }
    ParamInfo param = new ParamInfo(info, null, value, length);
    param.isUnicode =
        info.sqlType.equals("nvarchar")
            || info.sqlType.equals("nchar")
            || info.sqlType.equals("ntext");
    param.markerPos = pos;

    return param;
  }