java.sql.NClob.setAsciiStream()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(99)

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

NClob.setAsciiStream介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@Override
  public NClob mergeNClob(NClob original, NClob target, SharedSessionContractImplementor session) {
    if ( original != target ) {
      try {
        // the NCLOB just read during the load phase of merge
        final OutputStream connectedStream = target.setAsciiStream( 1L );
        // the NCLOB from the detached state
        final InputStream detachedStream = original.getAsciiStream();
        StreamCopier.copy( detachedStream, connectedStream );
        return target;
      }
      catch (SQLException e ) {
        throw session.getFactory().getSQLExceptionHelper().convert( e, "unable to merge NCLOB data" );
      }
    }
    else {
      return NEW_LOCATOR_LOB_MERGE_STRATEGY.mergeNClob( original, target, session );
    }
  }
};

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

@Override
  public OutputStream call() throws SQLException {
    return nclob.setAsciiStream(pos);
  }
});

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

clob = connection.createNClob();
try {
  IOUtils.copy((InputStream) value, clob.setAsciiStream(1));
} catch (IOException exception) {
  throw new JdbcTypeException(exception);

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

@Override
  public NClob mergeNClob(NClob original, NClob target, SessionImplementor session) {
    if ( original != target ) {
      try {
        OutputStream connectedStream = target.setAsciiStream( 1L );  // the NCLOB just read during the load phase of merge
        InputStream detachedStream = original.getAsciiStream();      // the NCLOB from the detached state
        StreamCopier.copy( detachedStream, connectedStream );
        return target;
      }
      catch (SQLException e ) {
        throw session.getFactory().getSQLExceptionHelper().convert( e, "unable to merge NCLOB data" );
      }
    }
    else {
      return NEW_LOCATOR_LOB_MERGE_STRATEGY.mergeNClob( original, target, session );
    }
  }
};

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

@Override
  public NClob mergeNClob(NClob original, NClob target, SessionImplementor session) {
    if ( original != target ) {
      try {
        OutputStream connectedStream = target.setAsciiStream( 1L );  // the NCLOB just read during the load phase of merge
        InputStream detachedStream = original.getAsciiStream();      // the NCLOB from the detached state
        StreamCopier.copy( detachedStream, connectedStream );
        return target;
      }
      catch (SQLException e ) {
        throw session.getFactory().getSQLExceptionHelper().convert( e, "unable to merge NCLOB data" );
      }
    }
    else {
      return NEW_LOCATOR_LOB_MERGE_STRATEGY.mergeNClob( original, target, session );
    }
  }
};

代码示例来源:origin: org.hibernate.orm/hibernate-core

@Override
  public NClob mergeNClob(NClob original, NClob target, SharedSessionContractImplementor session) {
    if ( original != target ) {
      try {
        // the NCLOB just read during the load phase of merge
        final OutputStream connectedStream = target.setAsciiStream( 1L );
        // the NCLOB from the detached state
        final InputStream detachedStream = original.getAsciiStream();
        StreamCopier.copy( detachedStream, connectedStream );
        return target;
      }
      catch (SQLException e ) {
        throw session.getFactory().getSQLExceptionHelper().convert( e, "unable to merge NCLOB data" );
      }
    }
    else {
      return NEW_LOCATOR_LOB_MERGE_STRATEGY.mergeNClob( original, target, session );
    }
  }
};

相关文章