<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 周銳 閱讀(257) 評論(0)  編輯  收藏 所屬分類: Oracle
    主站蜘蛛池模板: 亚洲欧洲国产综合| 亚洲 暴爽 AV人人爽日日碰| 久久91亚洲精品中文字幕| 国产在亚洲线视频观看| 又大又粗又爽a级毛片免费看| 亚洲精品成人片在线播放| 91成人免费福利网站在线| 亚洲无人区午夜福利码高清完整版 | 亚洲av无码片区一区二区三区| 57pao一国产成永久免费| 内射无码专区久久亚洲| 日韩精品免费一线在线观看| 国产精品免费精品自在线观看| 亚洲日韩中文字幕| 欧美a级成人网站免费| 美女被爆羞羞网站免费| 久久久久亚洲?V成人无码| 激情无码亚洲一区二区三区| 亚洲免费中文字幕| 亚洲熟妇无码乱子AV电影| 免费91最新地址永久入口| 亚洲美女在线观看播放| 最近最好的中文字幕2019免费| 亚洲嫩模在线观看| 91香蕉视频免费| 亚洲一区二区三区四区视频 | 亚洲老熟女五十路老熟女bbw | 亚洲伊人久久精品| 国产小视频免费观看| 两个人看的www免费视频中文| 亚洲高清中文字幕| 国产精品嫩草影院免费| 永久在线观看免费视频| 国产成人精品日本亚洲专| 亚洲日韩人妻第一页| 免费人成视频在线播放| 亚洲精品免费视频| 免费一级毛片在播放视频| 久久国产精品免费看| 欧美日韩亚洲精品| 亚洲成a人片在线观看日本麻豆|