One: Reference URL
http://sunbin123.iteye.com/blog/1007556
Two: Example
@Autowired @Qualifier ("JdbcTemplate") PrivateJdbcTemplate JdbcTemplate; @SuppressWarnings ("Unchecked") Publicinteger Getserno () {integer Param2value=Jdbctemplate.execute (NewCallableStatementCreator () { PublicCallableStatement createcallablestatement (Connection con)throwsSQLException {String StoredProc= "{call Getsno (?,?)}";//the SQL that is calledCallableStatement cs =Con.preparecall (StoredProc); Cs.setstring (1, Sno);//setting values for input parametersCs.registeroutparameter (2, Java.sql.Types.INTEGER); returnCS; } }, NewCallableStatementCallback () { PublicObject doincallablestatement (CallableStatement cs)throwsSQLException, DataAccessException {cs.execute (); returnCs.getint (2);//gets the value of the output parameter } }); returnParam2value; }
Spring heibernate Call Stored procedure