提示如何使用IN参数(Clob)调用过程,然后解析OUT参数。 (CLOB)
对于JDBC,我找到了this case。我如何用JPA和EclipseLink来实现它
答案 0 :(得分:0)
创建Clob:
Clob clobR = null;
try {
Connection conn = em.unwrap(Connection.class);
java.sql.Connection con2 = conn.getMetaData().getConnection();
clobR = con2.createClob();
clobR.setString(START_POSITION, data);
} catch (SQLException e) {
e.printStackTrace();
}
通话程序:
StoredProcedureQuery query = em.createStoredProcedureQuery(name);
query.registerStoredProcedureParameter(paramName, type, mode);
query.setParameter(paramName, value);