<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 431,  comments - 344,  trackbacks - 0

    內容或簡介:
    /**
    調用數據庫里的一個函數
    一個函數本質上一個返回一個結果的存儲過程,這個例子示范了怎么調用有in、out和in/out參數的函數
    ***********************************/
    CallableStatement cs;
    try {
    // 調用一個沒有參數的函數; 函數返回 a VARCHAR
    // 預處理callable語句 
        cs = connection.prepareCall("{? = call myfunc}");

    // 注冊返回值類型
        cs.registerOutParameter(1, i);

    // Execute and retrieve the returned value
        cs.execute();
        String retValue = cs.getString(1);

    // 調用有一個in參數的函數; the function returns a VARCHAR
        cs = connection.prepareCall("{? = call myfuncin(?)}");

    // Register the type of the return value
        cs.registerOutParameter(1, Types.VARCHAR);

    // Set the value for the IN parameter
        cs.setString(2, "a string");

    // Execute and retrieve the returned value
        cs.execute();
        retValue = cs.getString(1);

    // 調用有一個out參數的函數; the function returns a VARCHAR
        cs = connection.prepareCall("{? = call myfuncout(?)}");

    // Register the types of the return value and OUT parameter
        cs.registerOutParameter(1, Types.VARCHAR);
        cs.registerOutParameter(2, Types.VARCHAR);

    // Execute and retrieve the returned values
        cs.execute();
        retValue = cs.getString(1);           // return value
        String outParam = cs.getString(2);    // OUT parameter

    // 調用有一個in/out參數的函數; the function returns a VARCHAR
        cs = connection.prepareCall("{? = call myfuncinout(?)}");

    // Register the types of the return value and OUT parameter
        cs.registerOutParameter(1, Types.VARCHAR);
        cs.registerOutParameter(2, Types.VARCHAR);

    // Set the value for the IN/OUT parameter
        cs.setString(2, "a string");

    // Execute and retrieve the returned values
        cs.execute();
        retValue = cs.getString(1);           // return value
        outParam = cs.getString(2);           // IN/OUT parameter
    } catch (SQLException e) {
    }

    posted on 2009-03-11 21:05 周銳 閱讀(267) 評論(0)  編輯  收藏 所屬分類: Oracle
    主站蜘蛛池模板: 亚洲国模精品一区| 亚洲精品久久久www| 国产成人A人亚洲精品无码| 亚洲精品免费视频| 亚洲国产高清美女在线观看| 色天使亚洲综合一区二区| 欧洲人免费视频网站在线| 免费电视剧在线观看| 亚洲午夜爱爱香蕉片| 亚洲中文字幕无码久久| 视频免费在线观看| 午夜小视频免费观看| 久久精品国产精品亚洲人人| 亚洲精品第一国产综合野| 好男人资源在线WWW免费| 午夜一级免费视频| 羞羞漫画登录页面免费| 中文字幕无码不卡免费视频| 亚洲人成人网站在线观看| 国产成人无码免费看片软件| 妞干网免费视频在线观看| 911精品国产亚洲日本美国韩国| 国产AV无码专区亚洲AV琪琪| 国产成人午夜精品免费视频| 亚洲成av人无码亚洲成av人| 国产四虎免费精品视频| 久久精品国产亚洲香蕉| 黄视频在线观看免费| 亚洲无码精品浪潮| 亚洲成人免费在线| 亚洲成a人片在线观看日本 | 精品韩国亚洲av无码不卡区| 亚洲AV无码乱码精品国产| 亚洲欧美中文日韩视频| 波多野结衣免费在线观看| 亚洲成AV人影片在线观看| 国产亚洲一区二区精品| 3344在线看片免费| 香蕉蕉亚亚洲aav综合| 香港a毛片免费观看| 亚洲AV无码专区在线电影成人 |