hinbernate调用存储过程取值问题
用hibernate调用存储过程,下面红色部分换成query.executeUpdate()的话能执行,不过我想取值,如果不用游标传参的话,怎么做?java代码:
List list = this.getHibernateTemplate().executeFind(new HibernateCallback() {
@Override
public Object doInHibernate(Session session) throws HibernateException,
SQLException {
SQLQuery query = (SQLQuery) session.createSQLQuery("{call CRM_FOR_SPR.QUERYBASEDATA(?)}");
query.setLong(0, olId);
return query.list();
}
});
存储过程:
CREATE OR REPLACE PACKAGE BODY CRM_FOR_SPR IS
PROCEDURE QUERYBASEDATA(olId IN number) IS
v_rem varchar2(20);
BEGIN
select remarks into v_rem from SO.BUSI_ORDER where ol_id = olId;
END QUERYBASEDATA;
END CRM_FOR_SPR; hibernate oracle 存储过程 java
补充:Java , Java EE