Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2005, 05:59 AM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default java.sql.SQLException: Invalid argument(s) in call

The code:

ArrayList roeModelList = new ArrayList();
           Connection conn=null;
        CallableStatement cstmt=null;
        ResultSet rs=null;
        GenericDAO dao = new GenericDAO();
        try
        {
                 conn=dao.getConnection();
                  String[] pipelineRunNumArr = new String[0]; // since approver list doen't depends on pipeline run number
                    cstmt = conn.prepareCall(ROESql.getROEApproverRejectListSP );
                    cstmt.registerOutParameter(1,Types.INTEGER);
                 cstmt.registerOutParameter(9,OracleTypes.CURSOR);
                 cstmt.registerOutParameter(10,Types.VARCHAR);
                 cstmt.setString(2,null); // version num
                 cstmt.setArray(3,null); // process status array
            }catch(Exception e)
          {
            System.out.println(e.getMessage());
            e.printStackTrace();
          }finally
           {
               if (cstmt != null)
               {
                 cstmt.close();
                 cstmt = null;

               }
               if(conn!=null)
               {
                    dao.releaseConnection(conn);
               }
           }

         }


Throws the following exception:

java.sql.SQLException: Invalid argument(s) in call
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:269)
        at oracle.jdbc.driver.OraclePreparedStatement.setARRA Y(OraclePreparedSta
tement.java:1707)
        at oracle.jdbc.driver.OraclePreparedStatement.setArra y(OraclePreparedSta
tement.java:1681)
        at JDBCVersion.main(JDBCVersion.java:57)


 
Old May 5th, 2005, 02:58 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

Check the No. of parameters to be passed to the SQL and make assumption in the same sequence.

CallableStatement cstmt = con.prepareCall(
                          "{call getTestData(?, ?)}");
    cstmt.registerOutParameter(1, java.sql.Types.TINYINT);
    cstmt.registerOutParameter(2, java.sql.Types.DECIMAL, 3);
    cstmt.executeQuery();
    byte x = cstmt.getByte(1);
    java.math.BigDecimal n = cstmt.getBigDecimal(2, 3);






Gokulan Ethiraj





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Invalid postback or call back argument kalyanykk ASP.NET 2.0 Basics 0 August 26th, 2008 06:03 AM
java.sql.SQLException [email protected] SQL Server 2000 1 March 22nd, 2006 08:57 AM
java.sql.SQLException: Column 'somenam' not found. gargon1 JSP Basics 3 August 5th, 2005 12:35 PM
java.sql.SQLException: Invalid column type Che Guevara Java Databases 1 July 1st, 2005 07:39 AM
Invalid procedure call or argument: 'AscB' harish3699 VBScript 1 January 28th, 2004 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.