oracle Clob to string

public String clobToString(oracle.sql.CLOB clob){
		Reader isClob;
		String contentstr="";
		StringBuffer sbResult = new StringBuffer();
		try {	
			isClob = clob.getCharacterStream();
			BufferedReader bfClob = new BufferedReader(isClob);
			String strClob = bfClob.readLine();
			while(strClob != null) {
			   sbResult.append(strClob);
			   strClob = bfClob.readLine();
			}
			contentstr=sbResult.toString();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return contentstr;
	}

你可能感兴趣的:(java,oracle,sql)