I have a problem while trying to call the store procedure and return the out parameter:
Here is my procedure:
Create or replace procedure check_date(intNum IN number,
outDATE OUT DATE) is
begin
select sysdate into outDATE from dual;
end;
this code execute successfully in pl/sql.
My java code as follow:
public class StoreProcedure2
{
public static void main(String[] args)
{
Connection conTest;
ResultSet rsTest = null;
CallableStatement cstmt = null;
conTest = DBConnect.getConnection();
int intTest = 12;
try
{
cstmt = conTest.prepareCall("{ call check_date(? ?)}");
System.out.println("after prepreCall");
cstmt.setInt(1, intTest);
System.out.println("after setInt=" + intTest);
cstmt.registerOutParameter(2, Types.DATE);
System.out.println("after register");
cstmt.execute();
System.out.println("after execute");
System.out.println("give me the out parameter: " + cstmt.getDate(2));
cstmt.close();
}
catch(Exception error)
{
System.err.println("exception:" + error.getMessage());
}
}
}
//****************
Here are the error msg I got when run it in java:
exception:ORA-06550: line 1, column 21:
PLS-00103: Encountered the symbol "" when expecting one of the following:
. ( ) , * @ % & | = - + < / > at in mod not range rem => ..
<an exponent (**)> <> or != or ~= >= <= <> and or like as
between from using is null is not | | indicator is dangling
The symbol "," was substituted for "" to continue.
I really need help on this! I will be very appreciate your help!
Thanks very much!
Mindy