pravin
09-16-2003, 03:28 AM
i have written a small procedure ,which stores the data in a table.
and while calling it from the java code,itz throwing invalid object
(invalid procedure name).
while we compile it in sql,itz getting compile with no errors.
please let me know where it is wrong.
THE STORED PROCEDURE CODE
==========================
create or replace procedure st_proc as
declare id number;
begin
select word_id into id from words ;
insert into words_desc values(id,'desc for first word');
end;
java code:
=========
try
{
con = getDBConnection();
System.out.println("con = "+con);
cs = con.prepareCall("{call st_proc}");
System.out.println("cs = "+cs);
cs.execute();
}catch(SQLException e)
{
e.printStackTrace(System.out);
System.out.println("................");
System.out.println(e);
}finally
{
try{
cs.close();
con.close();
}catch(Exception e){}
}
and while calling it from the java code,itz throwing invalid object
(invalid procedure name).
while we compile it in sql,itz getting compile with no errors.
please let me know where it is wrong.
THE STORED PROCEDURE CODE
==========================
create or replace procedure st_proc as
declare id number;
begin
select word_id into id from words ;
insert into words_desc values(id,'desc for first word');
end;
java code:
=========
try
{
con = getDBConnection();
System.out.println("con = "+con);
cs = con.prepareCall("{call st_proc}");
System.out.println("cs = "+cs);
cs.execute();
}catch(SQLException e)
{
e.printStackTrace(System.out);
System.out.println("................");
System.out.println(e);
}finally
{
try{
cs.close();
con.close();
}catch(Exception e){}
}