oracle 中数据类型为clob的编辑

public void updateKpiStatus(String kpiStatus,String taskId){
	Connection dbc=null;
	Statement stmt=null;
	PreparedStatement ps=null;
	try {
		dbc = new DBConn().getNewConnection();
		//stmt = dbc.createStatement();
		String sql=" update rm.thresholdcontent "
  			+" set kpi_status=?"
  			+" where id=? ";
		ps=dbc.prepareStatement(sql);
		java.io.Reader clobReader = new java.io.StringReader(kpiStatus); // 将 text转成流形式  
        ps.setCharacterStream(1, clobReader, kpiStatus.length());// 替换sql语句中的? 
		ps.setString(2, taskId);
		ps.executeUpdate();
		dbc.commit();
		//stmt.execute(sql);
	} catch (Exception e) {
		e.printStackTrace();
	}}

你可能感兴趣的