<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 周銳 閱讀(256) 評論(0)  編輯  收藏 所屬分類: Oracle
    主站蜘蛛池模板: 四虎影视在线永久免费观看| 日本片免费观看一区二区| 国产又粗又长又硬免费视频| 久久久久se色偷偷亚洲精品av | 久久狠狠爱亚洲综合影院| 91九色老熟女免费资源站| 亚洲国产综合精品| 岛国av无码免费无禁网站| 亚洲中文无码永久免费| 又黄又爽的视频免费看| www免费插插视频| 亚洲精品字幕在线观看| 91视频免费网址| 亚洲综合无码一区二区痴汉| 国产免费爽爽视频免费可以看| 免费VA在线观看无码| 国产日产亚洲系列| 精品无码人妻一区二区免费蜜桃| 亚洲人成电影亚洲人成9999网| 国产精品色拉拉免费看| 亚洲人成自拍网站在线观看| 亚洲第一区精品观看| A片在线免费观看| 亚洲综合色7777情网站777| 国产一级淫片a免费播放口之| WWW国产成人免费观看视频| 亚洲综合在线视频| 免费高清在线爱做视频| 久久免费观看视频| 亚洲午夜精品一区二区公牛电影院| 影音先锋在线免费观看| 两个人www免费高清视频| 亚洲av永久无码嘿嘿嘿 | 妞干网在线免费观看| 日亚毛片免费乱码不卡一区| 亚洲欧洲国产精品香蕉网| 青青在线久青草免费观看| 美女被免费网站在线视频免费| 久久久久亚洲AV无码永不| 又黄又爽一线毛片免费观看| 2021精品国产品免费观看|