标签:
Connection conn = this.getHibernateTemplate() .getSessionFactory().getCurrentSession().connection(); String sqlclob = "Select o.value_clob from os_propertyset o Where o.property_key=? and o.entry_id=? FOR Update "; PreparedStatement pstmt = conn.prepareStatement(sqlclob); pstmt.setString(1, propertyKey); pstmt.setLong(2, entryID); // 手动提交 conn.setAutoCommit(false); ResultSet rs = pstmt.executeQuery(); rs = pstmt.executeQuery(); oracle.sql.CLOB lob = null; if (rs.next()) { lob = (oracle.sql.CLOB) rs.getClob(1); } try { Writer os = lob.getCharacterOutputStream(); os.write(valueString); os.flush(); conn.commit(); } catch (IOException e) { e.printStackTrace(); }finally{ if(conn!=null){ conn.close(); } }
标签:
原文地址:http://my.oschina.net/kkrgwbj/blog/501833