有JIVE的源代码吗?
看一下ConnectionManager.java 里面有一个setLargeTextField 方法。
/**
* Sets a large text column in a result set, automatically performing
* streaming if the JDBC driver requires it. This is necessary because
* different JDBC drivers have different capabilities and methods for
* setting large text values.
*
* @param pstmt the PreparedStatement to set the text field in.
* @param parameterIndex the index corresponding to the text field.
* @param value the String to set.
*/
public static void setLargeTextField(PreparedStatement pstmt,
int parameterIndex, String value) throws SQLException
{
if (streamLargeText) {
Reader bodyReader = null;
try {
bodyReader = new StringReader(value);
pstmt.setCharacterStream(parameterIndex, bodyReader, value.length());
}
catch (Exception e) {
e.printStackTrace();
throw new SQLException("Failed to set text field.");
}
// Leave bodyReader open so that the db can read from it. It *should*
// be garbage collected after it's done without needing to call close.
}
else {
pstmt.setString(parameterIndex, value);
}
}