Here you can find the source of readStringClob(Clob content)
Parameter | Description |
---|---|
content | a parameter |
Parameter | Description |
---|---|
SQLException | an exception |
IOException | an exception |
public static String readStringClob(Clob content) throws SQLException, IOException
//package com.java2s; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.io.*; import java.sql.*; public class Main { /**/* w ww. ja v a 2s .c o m*/ * * @param content * @return String * @throws SQLException * @throws IOException */ public static String readStringClob(Clob content) throws SQLException, IOException { if (content == null) { return null; } Reader reader = content.getCharacterStream(); BufferedReader in = new BufferedReader(reader); StringBuilder rc = new StringBuilder(); char[] chars = new char[256]; int count; while ((count = in.read(chars)) > 0) { rc.append(chars, 0, count); } return rc.toString(); } }