@Override
public void setClobAsAsciiStream(
PreparedStatement ps, int paramIndex, InputStream asciiStream, int contentLength)
throws SQLException {
if (streamAsLob) {
if (asciiStream != null) {
try {
ps.setClob(paramIndex, new InputStreamReader(asciiStream, "US-ASCII"), contentLength);
}
catch (UnsupportedEncodingException ex) {
throw new SQLException("US-ASCII encoding not supported: " + ex);
}
}
else {
ps.setClob(paramIndex, (Clob) null);
}
}
else if (wrapAsLob) {
if (asciiStream != null) {
ps.setClob(paramIndex, new PassThroughClob(asciiStream, contentLength));
}
else {
ps.setClob(paramIndex, (Clob) null);
}
}
else {
ps.setAsciiStream(paramIndex, asciiStream, contentLength);
}
if (logger.isDebugEnabled()) {
logger.debug(asciiStream != null ? "Set ASCII stream for CLOB with length " + contentLength :
"Set CLOB to null");
}
}
DefaultLobHandler.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:lams
作者:
评论列表
文章目录