public String clobToString(Object convertData){
	      if(convertData!=null){
	         CLOB clobData = (CLOB)convertData;
	         StringBuffer returnStr = new StringBuffer();
	         try {
	            Reader reader       = clobData.getCharacterStream();
	            char[] buff       = new char[1024];
	            int nchars          = 0;
	            while ((nchars = reader.read(buff)) > 0) {
	               returnStr.append(buff, 0, nchars);
	            }
	         }catch (SQLException e) {
	            e.printStackTrace();
	         }catch (IOException e) {
	            e.printStackTrace();
	         }
	         return returnStr.toString();
	      }else{
	         return "";
	      }
	   }
반응형
Posted by 질주하는구
,