1.这里只给出一个方法
public String processData(final String period) throws Exception {
return (String)this.getHibernateTemplate().execute(new HibernateCallback() {
@Override
public Object doInHibernate(Session session) throws HibernateException,
SQLException {
Connection conn = session.connection();
CallableStatement pstmt = null;
String result = null;
try{
pstmt = conn.prepareCall("{ call create_cal_report_data(?,?)}");
pstmt.setString(1, period);
pstmt.registerOutParameter(2,java.sql.Types.VARCHAR);
pstmt.executeQuery();
result = (String) pstmt.getObject(3);
}catch(Exception e){
e.printStackTrace();
}
return result;
}
});
}