Session session = this.getHibernateTemplate().getSessionFactory().openSession();
Connection conn = session.connection();
try {
String sql = "{call test_pro(?,?)}";
CallableStatement call = conn.prepareCall(sql);
call.setInt(1, htbaId);//设置第一个参数
call.registerOutParameter(2, OracleType.STYLE_INT);//注册输出的参数
call.execute();
int re = call.getInt(2);
if (re == 1) {
flag= true;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (conn != null) {
try {
conn.close();
session.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交