zoukankan      html  css  js  c++  java
  • JAVA JDBC 调用 oracle 函数的时候,注意格式,{}, 调用关键字 call 勿必要小写。

    conn = CM.getConnection();
    cstam = conn.prepareCall("{? = CALL FN_QUERY_ACCIDENTS_BY_PAGER(?,?,?,?,?,?,?,?,?,?)}");
    cstam.registerOutParameter(1, OracleTypes.CURSOR);
    cstam.setLong(2, 0);//对应 P_LISTOREXPORT NUMBER, --查询类型 列表 0,导出 1
    cstam.setLong(3, agencyId);
    cstam.setLong(4, unitId);
    cstam.setString(5, numberPlate);
    cstam.setString(6, driver);
    cstam.setString(7, beginTime);
    cstam.setString(8, endTime);
    cstam.setInt(9, start);
    cstam.setInt(10, limit);
    cstam.registerOutParameter(11, OracleTypes.NUMBER);
     
    cstam.execute();
    rs = (ResultSet) cstam.getObject(1);
    count = cstam.getInt(11);
     
     
    "{? = CALL FN_QUERY_ACCIDENTS_BY_PAGER(?,?,?,?,?,?,?,?,?,?)}"
     
    调用函数注意事项:
    1. call 一定要小写,不然会卡在 execute();
    2. 一定要用花括号包围
    3. 函数返回 ? = 接收。 
  • 相关阅读:
    毛皮立方体
    APPLE buSinEss
    #4613. problem C
    #4614. problem B
    idiots
    熊猫(i)
    圆盘自动机 cell
    小L的占卜
    有趣的数(number)
    「JOISC 2015 Day 1」卡片占卜
  • 原文地址:https://www.cnblogs.com/lanfengniao/p/3122547.html
Copyright © 2011-2022 走看看