Here you can find the source of getCLOBContent(ResultSet rs, int clobidx)
Parameter | Description |
---|---|
rs | the rs |
clobidx | the clobidx |
Parameter | Description |
---|---|
Exception | the exception |
public static String getCLOBContent(ResultSet rs, int clobidx) throws Exception
//package com.java2s; import java.io.Reader; import java.sql.Clob; import java.sql.ResultSet; public class Main { /**/*from w w w . jav a 2 s . com*/ * Gets the cLOB content. * * @param rs * the rs * @param clobidx * the clobidx * @return the cLOB content * @throws Exception * the exception */ public static String getCLOBContent(ResultSet rs, int clobidx) throws Exception { 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) { content = content + new String(buffer, 0, count); } } return content; } }