hibernate调用oracle存储过程||函数

pakeage dao.Impl;

//调用函数FUN_GET();

public String get(String Id,String Name){

return getSession().createSQLQuery("select FUN_GET(?,?) from dual")
.setParameter(0, Id).setParameter(1, Name).uniqueResult()
.toString();

}

//uniqueResult()  返回唯一值

//调用存储过程

CallableStatement call = connection.prepareCall("{call ?:=FUN_GETSTUNO(?,?)}");
call.registerOutParameter(1, Types.VARCHAR);
call.setString(2, Id);
call.setString(3, inDate);
call.executeQuery();

原文地址:https://www.cnblogs.com/-lpf/p/4347821.html