本文整理汇总了Java中java.sql.Clob.getAsciiStream方法的典型用法代码示例。如果您正苦于以下问题:Java Clob.getAsciiStream方法的具体用法?Java Clob.getAsciiStream怎么用?Java Clob.getAsciiStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.Clob
的用法示例。
在下文中一共展示了Clob.getAsciiStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mergeClob
import java.sql.Clob; //导入方法依赖的package包/类
@Override
public Clob mergeClob(Clob original, Clob target, SessionImplementor session) {
if ( original != target ) {
try {
// the CLOB just read during the load phase of merge
final OutputStream connectedStream = target.setAsciiStream( 1L );
// the CLOB 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 CLOB data" );
}
}
else {
return NEW_LOCATOR_LOB_MERGE_STRATEGY.mergeClob( original, target, session );
}
}
示例2: getClobAsAsciiStream
import java.sql.Clob; //导入方法依赖的package包/类
@Override
public InputStream getClobAsAsciiStream(ResultSet rs, int columnIndex) throws SQLException {
logger.debug("Returning Oracle CLOB as ASCII stream");
Clob clob = rs.getClob(columnIndex);
initializeResourcesBeforeRead(rs.getStatement().getConnection(), clob);
InputStream retVal = (clob != null ? clob.getAsciiStream() : null);
releaseResourcesAfterRead(rs.getStatement().getConnection(), clob);
return retVal;
}
示例3: getClobAsAsciiStream
import java.sql.Clob; //导入方法依赖的package包/类
@Override
public InputStream getClobAsAsciiStream(ResultSet rs, int columnIndex) throws SQLException {
logger.debug("Returning CLOB as ASCII stream");
if (this.wrapAsLob) {
Clob clob = rs.getClob(columnIndex);
return clob.getAsciiStream();
}
else {
return rs.getAsciiStream(columnIndex);
}
}