<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
    主站蜘蛛池模板: 国产精品亚洲一区二区三区久久 | 久久99久久成人免费播放| 亚洲福利一区二区三区| 亚洲麻豆精品国偷自产在线91| 四虎永久在线精品免费观看视频| 国产一级a毛一级a看免费视频| 亚洲国产成人AV网站| 亚洲国产精品乱码在线观看97| 亚洲熟妇av一区二区三区| 四虎影视免费永久在线观看| ww在线观视频免费观看| 精品视频在线免费观看| 一级视频在线免费观看| 含羞草国产亚洲精品岁国产精品| 亚洲最大黄色网站| 久久亚洲成a人片| 亚洲午夜国产精品无码老牛影视 | 亚洲av永久无码| 亚洲一级片在线观看| 亚洲视频免费在线观看| 亚洲欧洲中文日韩av乱码| 国产一区二区视频免费| 永久免费看mv网站入口| 毛片免费在线播放| 99精品国产免费久久久久久下载 | 99久久婷婷国产综合亚洲| 18gay台湾男同亚洲男同| 亚洲成AV人片在线观看无码| 亚洲一区精品中文字幕| 亚洲色一色噜一噜噜噜| 亚洲国产三级在线观看| 亚洲另类少妇17p| 亚洲一区二区三区无码影院| 亚洲成av人在片观看| 免费一级毛片免费播放| 免费v片在线观看| 国产一区二区视频免费| www.亚洲精品.com| 深夜国产福利99亚洲视频| 国产免费人视频在线观看免费| 日韩视频免费在线|