Hi,
i am using oracle 8i.I wrote a simple procedure.It is working on the backend.When i am trying to access the same procedure from a
java program,i am getting the following exception
Exception is:java.sql.SQLException: invalid arguments in call.
Here is my java program .
import java.sql.*;
import java.util.*;
public class TestProc
{
public static void main(
String args[]) throws Exception
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:SIVA");
CallableStatement cstmt=conn.prepareCall("{ call task (?,?) }");
int a=10;
int b=20;
cstmt.setInt(1,a);
cstmt.setInt(2,b);
cstmt.executeQuery();
SQLWarning sqlw = cstmt.getWarnings();
System.out.println(sqlw);
}
catch(Exception e)
{
System.out.println("Exception is:"+e.toString());
}
}
}
Here is the procedure i wrote
create or replace procedure task(pone in number,ptwo in number)
as
begin
insert into emp1(eno,esal) values(pone,ptwo);
end task ;
Here is my database table
ENO NUMBER(5)
NAME VARCHAR2(5)
SAL NUMBER(5)
Please tell me why this exception is coming.
Thanks in Advance,
Regards,
Siva