コード例 #1
0
 public void setObject(int parameterIndex, Object x) throws SQLException {
   if (x instanceof SQLXML) {
     setSQLXML(parameterIndex, (SQLXML) x);
   } else {
     super.setObject(parameterIndex, x);
   }
 }
コード例 #2
0
  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);
  }
コード例 #3
0
  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);
    }
  }