本文共 1032 字,大约阅读时间需要 3 分钟。
JDBC ?? CLOB ????
? Java ?????? Oracle ????? CLOB ?????????????????????????? JDBC ?? CLOB ?????????????
???JDBC ???????????????autoCommit??????????????????????? autoCommit ? false?
?? autoCommit ? false
conn.setAutoCommit(false);??? CLOB ??
?? emptyClob() ????? CLOB ???CLOB clob = emptyClob();?? CLOB ?????
? CLOB ?????????????? CLOB ?????insert into clob_table (clob_field) values clob;?? CLOB ??
????? CLOB ???????? SELECT ?????? for update ???select clob_field from clob_table where rowid=1 for update;?? CLOB ??
?? ResultSet ?? CLOB ?????????????????Clob clob = (Clob) rs.getClob("clob_field");String str = clob.getSubString(1, clob.length());?? PreparedStatement ?? DML ??
??????????? PreparedStatement ??????????conn.prepareStatement("update clob_table set clob_field=? where rowid=1");pstmt1.setClob(1, clob);pstmt1.execute();????
????????????? conn.commit() ?????conn.commit();????????????? SQLException ???????????????CLOB ????????????????????????? CLOB ??????????
???????? JDBC ?? CLOB ???????????????????
转载地址:http://ixpfk.baihongyu.com/