Java Utililty Methods SQL ResultSet Clob Read

List of utility methods to do SQL ResultSet Clob Read

Description

The list of methods to do SQL ResultSet Clob Read are organized into topic(s).

Method

StringgetClobAsString(ResultSet rs, String name, String ifnull)
get Clob As String
String strClob = null;
Clob clob = rs.getClob(name);
if (clob != null)
    strClob = clobToString(clob, ifnull);
return strClob;
StringgetCLOBContent(ResultSet rs, int clobidx)
Gets the cLOB content.
Clob clobField = null;
String content = "";
int count = 0;
char buffer[] = new char[4086];
clobField = rs.getClob(clobidx);
if (clobField != null) {
    Reader reader = clobField.getCharacterStream();
    while ((count = reader.read(buffer)) > 0) {
...
StringgetOracleClob(ResultSet p_rset, int p_col)
static method for fetching an Oracle CLOB value
if (p_rset == null) {
    Logger.getAnonymousLogger().severe("NULL ResultSet detected"); 
    return ""; 
try {
    Clob v_clob = p_rset.getClob(p_col);
    if (v_clob != null) {
        Reader v_stream;
...
StringreadClobUTF16BinaryStream(ResultSet rs, String fieldName)
read clob into a string
Clob clob = rs.getClob(fieldName);
Reader clobStream = clob.getCharacterStream();
StringBuffer clobData = new StringBuffer();
int nchars = 0;
char[] buffer = new char[4096];
while ((nchars = clobStream.read(buffer)) != -1)
    clobData.append(buffer, 0, nchars);
clobStream.close();
...