java.sql.SQLXML.setBinaryStream()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中java.sql.SQLXML.setBinaryStream()方法的一些代码示例,展示了SQLXML.setBinaryStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SQLXML.setBinaryStream()方法的具体详情如下:
包路径:java.sql.SQLXML
类名称:SQLXML
方法名:setBinaryStream

SQLXML.setBinaryStream介绍

[英]Returns a stream that can be used to write binary data to this SQL XML object.
[中]返回可用于将二进制数据写入此SQL XML对象的流。

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Override
  protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
    provider.provideXml(xmlObject.setBinaryStream());
  }
};

代码示例来源:origin: co.paralleluniverse/comsat-jdbc

@Override
  public OutputStream call() throws SQLException {
    return sqlXML.setBinaryStream();
  }
});

代码示例来源:origin: teiid/teiid

public OutputStream setBinaryStream() throws SQLException {
  return this.reference.setBinaryStream();
}

代码示例来源:origin: org.teiid/teiid-common-core

public OutputStream setBinaryStream() throws SQLException {
  return this.reference.setBinaryStream();
}

代码示例来源:origin: apache/servicemix-bundles

@Override
  protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
    provider.provideXml(xmlObject.setBinaryStream());
  }
};

代码示例来源:origin: org.springframework/org.springframework.jdbc

@Override
  protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
    provider.provideXml(xmlObject.setBinaryStream());
  }
};

代码示例来源:origin: nuodb/migration-tools

@Override
public <X> SQLXML wrap(X value, Connection connection) throws SQLException {
  if (value == null) {
    return null;
  }
  SQLXML sqlXml;
  if (String.class.isInstance(value)) {
    sqlXml = connection.createSQLXML();
    sqlXml.setString((String) value);
  } else if (InputStream.class.isInstance(value)) {
    sqlXml = connection.createSQLXML();
    try {
      IOUtils.copy((InputStream) value, sqlXml.setBinaryStream());
    } catch (IOException exception) {
      throw new JdbcTypeException(exception);
    }
  } else if (Reader.class.isInstance(value)) {
    sqlXml = connection.createSQLXML();
    try {
      IOUtils.copy((Reader) value, sqlXml.setCharacterStream());
    } catch (IOException exception) {
      throw new JdbcTypeException(exception);
    }
  } else {
    throw newWrapFailure(value);
  }
  return sqlXml;
}

相关文章