Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 7th, 2005, 05:59 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
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)


  #2 (permalink)  
Old May 5th, 2005, 02:58 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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 muthumari_p2003@yahoo.com 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



All times are GMT -4. The time now is 01:50 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.