This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes help:java.sql.SQLException: ORA-06550 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "help:java.sql.SQLException: ORA-06550" Watch "help:java.sql.SQLException: ORA-06550" New topic
Author

help:java.sql.SQLException: ORA-06550

elli dian
Greenhorn

Joined: May 18, 2006
Posts: 15
I have a stored procedure.
The name of stored procedure is isClockingProblem(company,emp,clockingdate) return number.
0=ok,1=no clocking, 2=no out data.
So i want to call the stored procedure, but i get error:
SystemErr R java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'ISCLOCKINGPROBLEM'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

my code:
try
{
System.out.println("Calling a procedure");
CallableStatement cs=conn.prepareCall("{call IFSAPP.WEBASE_UTIL_API.isClockingProblem('DX','DX005010001',?,?)}");
cs.setTimestamp(1,new Timestamp(new java.util.Date().getTime()));
cs.registerOutParameter(2,Types.INTEGER);
cs.execute();
int a=cs.getInt(2);
cs.close();
System.out.println("Nilai"+a);
}catch(SQLException err)
{
err.printStackTrace();
}catch(Exception er)
{
er.printStackTrace();
}finally
{
System.out.println("finally");
conn.close();
}

please give me asolution to solve it...
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081


This is your stored procedure as you say, which takes 3 areguemnt as inputs and returns on output number

isClockingProblem(company,emp,clockingdate) return number




This is how you are calling your stored procedure and passing 4 arguemnts.

CallableStatement cs=conn.prepareCall("{call IFSAPP.WEBASE_UTIL_API.isClockingProblem('DX','DX005010001',?,?)}");




Now you can understand why are you getting the error
PLS-00306: wrong number or types of arguments in call to 'ISCLOCKINGPROBLEM'

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
 
subject: help:java.sql.SQLException: ORA-06550
 
Similar Threads
Loadjava and user_objects table
Oracle9i wrong number or types of arguments in call to...
Problem calling IN parameters Stored Procedure from Java
Calling a function vs a procedure on Oracle with CallableStatement
PLS-00201: identifier 'SEC_LBIC.LDAP_VIEW_APP_LIST' must be declared