String转化成CLOB并插入Oracle

PreparedStatement ps = conn.prepareStatement("INSERT INTO CLOBTABLE VALUES (?)");

oracle.sql.CLOB newClob = oracle.sql.CLOB.createTemporary(conn, false, oracle.sql.CLOB.DURATION_CALL);
newClob.putString(1, "This string, up to 4 gigabytes will be inserted into the CLOB");
ps.setClob(1, newClob);

你可能感兴趣的:(java,oracle,sql,UP)