當柳上原的風吹向天際的時候...

          真正的快樂來源于創造

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            368 Posts :: 1 Stories :: 201 Comments :: 0 Trackbacks
                     this.getJdbcTemplate().execute(
                          
          new CallableStatementCreator() {
                              
          public CallableStatement createCallableStatement(Connection con) throws SQLException {
                                  String storedProc 
          = "{call updatetractractcode(?, ?)}";// 調用的存儲過程
                                  CallableStatement cs = con.prepareCall(storedProc);
                                  cs.setInt(
          1, contractId);// 設置輸入參數的值
                                  cs.registerOutParameter(2, java.sql.Types.INTEGER);// 注冊輸出參數的類型
                                  return cs;
                              }
                          }, 
          new CallableStatementCallback() {
                              
          public Object doInCallableStatement(CallableStatement cs) throws SQLException, DataAccessException {
                                  cs.execute();
                                  
          return cs.getString(2);// 獲取輸出參數的值
                          }
                      });
          posted on 2011-06-02 09:05 何楊 閱讀(1145) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 金秀| 保靖县| 吴旗县| 新竹市| 应用必备| 沧州市| 兴文县| 镇赉县| 色达县| 同心县| 诏安县| 兴国县| 洛浦县| 天镇县| 闵行区| 济阳县| 双柏县| 运城市| 三江| 楚雄市| 江门市| 芜湖县| 昌图县| 淮南市| 左贡县| 海南省| 孙吴县| 汾阳市| 竹山县| 三门县| 嘉义县| 蓝山县| 阿合奇县| 佛山市| 麦盖提县| 兰西县| 新沂市| 贵州省| 邮箱| 家居| 扶余县|