将数据库查出的clob类型转换为String

1、将数据库查出的clob类型转换为String 

 if (burResult.next()) {    
	record.setBur_project_name(burResult.getString("bur_project_name"));    
	record.setBur_editer(burResult.getString("bur_editer"));    
	record.setEmployee_name(burResult.getString("employee_name"));    
	String project_des = null;    
	Clob  clob = burResult.getClob("project_des");    
	Reader inStream = clob.getCharacterStream();     
	char[] c = new char[(int) clob.length()];     
	try {    
		inStream.read(c);     
		project_des = new String(c);     
		inStream.close();     
	} catch (IOException e) {    
		// TODO Auto-generated catch block    
		e.printStackTrace();    
	}     
	record.setBur_project_description(project_des);    
}

 

你可能感兴趣的:(将数据库查出的clob类型转换为String)