本文整理了Java中java.sql.NClob.getAsciiStream()
方法的一些代码示例,展示了NClob.getAsciiStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NClob.getAsciiStream()
方法的具体详情如下:
包路径:java.sql.NClob
类名称:NClob
方法名:getAsciiStream
暂无
代码示例来源: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 InputStream call() throws SQLException {
return nclob.getAsciiStream();
}
});
代码示例来源:origin: br.com.anteros/Anteros-Core
result = IOUtils.toByteArray(asciiStream);
} else if (source instanceof NClob) {
InputStream asciiStream = ((NClob) source).getAsciiStream();
if (asciiStream == null)
return null;
代码示例来源:origin: nuodb/migration-tools
@Override
public <X> X unwrap(NClob value, Class<X> valueClass, Connection connection) throws SQLException {
if (value == null) {
return null;
} else if (valueClass.isAssignableFrom(NClob.class)) {
return (X) value;
} else if (valueClass.isAssignableFrom(char[].class)) {
try {
return (X) IOUtils.toString(value.getCharacterStream()).toCharArray();
} catch (IOException exception) {
throw new JdbcTypeException(exception);
}
} else if (valueClass.isAssignableFrom(String.class)) {
try {
return (X) IOUtils.toString(value.getCharacterStream());
} catch (IOException exception) {
throw new JdbcTypeException(exception);
}
} else if (valueClass.isAssignableFrom(Reader.class)) {
return (X) value.getCharacterStream();
} else if (valueClass.isAssignableFrom(OutputStream.class)) {
return (X) value.getAsciiStream();
} else {
throw newUnwrapFailure(valueClass);
}
}
}
代码示例来源:origin: jp.dodododo/samurai-dao
return ((NClob) value).getAsciiStream();
代码示例来源: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/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.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 );
}
}
};
代码示例来源:origin: usethesource/rascal
lw = vf.listWriter(TypeFactory.getInstance().integerType());
if (rs.getNClob(idx) != null) {
isr = rs.getNClob(idx).getAsciiStream();
if (isr != null) {
isrRes = isr.read();
内容来源于网络,如有侵权,请联系作者删除!