你好!
我在google.com输入:“java oracle 函数 调用”关键字
查找到:http://www.huihoo.com/java/oracle/oracle8i_java.html建议以后多利用搜索引擎。祝学习进步!

解决方案 »

  1.   

    那是说怎样用java开发oracle的java函数和java存储过程吧
    我现在是要用java调用oracle的function呀

    String temp="{call P_WBJK_GET_NSRXX_SSSQ(?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
    CallableStatement ps = conn.prepareCall(Sql);
    ……
    无法调用呀
      

  2.   

    System.setProperty("jdbc.drivers", "oracle.jdbc.driver.OracleDriver");
              Class.forName("oracle.jdbc.driver.OracleDriver");
                Connection conn= DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ouyang", "scott", "tiger");
                CallableStatement cstmt = conn.prepareCall("{ call Test_Query(?,?,?) }");
                
                cstmt.registerOutParameter (1, Types.VARCHAR);//output parameter
                cstmt.setString(1,"18879");
    cstmt.registerOutParameter (2, Types.VARCHAR);//output parameter
    cstmt.registerOutParameter (3, Types.FLOAT);//output parameter
    cstmt.execute();

    System.out.println("Procedure @par1 is '" + cstmt.getString(2) + "'");
                System.out.println("Procedure @par2 is '" + cstmt.getFloat(3) + "'\n");
      

  3.   

    ouygg(痞子酷):
    你写的是调用“存储过程”的方法吧,这个我早试过了,结果出错(如下):java.sql.SQLException: ORA-06550: ? 1 ?, ? 7 ?:
    PLS-00221: 'test_function' ?????????
    ORA-06550: ? 1 ?, ? 7 ?:
    PL/SQL: Statement ignored
      

  4.   

    是很明显的错误
    PLS-00221: 'test_function' is not a procedure 
    难道java真的不能调用oracle的函数吗??
      

  5.   

    大家是否有谁试过用java直接调用oracle内部函数的,来说说
      

  6.   

    用 select function_name(parm1,parm2,......) from dual;
      

  7.   

    哦,返回值可以得到(先给10分),但是out定义的参数不知道如何得到,有例子最好!