Session s = this.getSession();
CallableStatement cstm = null;
String flag = null;
try {
cstm = ((SessionImplementor) s)
.getBatcher()
.prepareBatchCallableStatement(
"call proc_applyfeelist(?,?,?,?)");
cstm.setString(1, applyfee.getSubcompany());
cstm.setDate(2, DateUtils
.toHibernateDate(applyfee.getStartdate()));
cstm.setDate(3, DateUtils
.toHibernateDate(applyfee.getEnddate()));
cstm.registerOutParameter(4, Types.CHAR);//返回值
cstm.execute();
flag = cstm.getString(4);//获取返回值
} catch (SQLException ex2) {
System.out.println(ex2.getMessage());
FormatUtils.throwSQLException(ex2.getMessage());
} finally { // 关闭cstm
try {
if (cstm != null)
cstm.close();
} catch (SQLException e) {
throw new BusinessException(e);
}
}