public void setObject(int parameterIndex, Object x) throws SQLException {
   if (x instanceof SQLXML) {
     setSQLXML(parameterIndex, (SQLXML) x);
   } else {
     super.setObject(parameterIndex, x);
   }
 }
  public void setNull(int parameterIndex, int targetSqlType) throws SQLException {
    checkClosed();
    int oid;
    switch (targetSqlType) {
      case Types.SQLXML:
        oid = Oid.XML;
        break;
      default:
        super.setNull(parameterIndex, targetSqlType);
        return;
    }

    if (adjustIndex) parameterIndex--;
    preparedParameters.setNull(parameterIndex, oid);
  }
  public void setObject(int parameterIndex, Object x, int targetSqlType, int scale)
      throws SQLException {
    checkClosed();

    if (x == null) {
      setNull(parameterIndex, targetSqlType);
      return;
    }

    switch (targetSqlType) {
      case Types.SQLXML:
        if (x instanceof SQLXML) {
          setSQLXML(parameterIndex, (SQLXML) x);
        } else {
          setSQLXML(parameterIndex, new Jdbc4SQLXML(connection, x.toString()));
        }
        break;
      default:
        super.setObject(parameterIndex, x, targetSqlType, scale);
    }
  }