日期:2014-05-16 浏览次数:20708 次
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(); }}