java调用oracle存储过程报错

2024-10-30 19:49:05
推荐回答(1个)
回答(1):

照葫芦画票吧

public String getTotalInfo(final long bid)
{
return (String)this.getHibernateTemplate().execute(new HibernateCallback(){

public Object doInHibernate(Session session)
throws HibernateException, SQLException {
// TODO Auto-generated method stub
CallableStatement cs=session.connection().prepareCall("{call bidcross(?,?)}");
cs.setLong(1, bid);
cs.registerOutParameter(2, Types.VARCHAR);
cs.execute();
return cs.getString(2);
}
});
}