你这个问题看看下面的例子也许会明白,希望能帮到你,纯手打
String oMsg = "";
public String custSignUp(final Map map){
String sql = "{call CUST_SIGN_UP_PROC(?,?)}";
String o_Msg;
o_Msg =(String) this.getJdbcTemplate().execute(sql,new CallableStatementCallback(){
public String doInCallableStatement(CallableStatement cs) throws SQLException, DataAccessException {
String gLiceCode = (String) map.get("custLicenceCode");
// System.out.println("!!gLiceCode: " + gLiceCode);
cs.setString(1,gLiceCode);
cs.registerOutParameter(2,OracleTypes.VARCHAR);//注册返回参数类型
cs.executeUpdate();
oMsg = cs.getString(2);
// System.out.println("!!oMsg: " + oMsg);
return oMsg;
}
});
System.out.println("!!o_Msg: " + o_Msg);
return o_Msg;
}