-
I created this package as follows:
create or replace package trypa is
function e(tryp boolean) return number;
end trypa;
/
create or replace package body trypa is
function e(tryp boolean) return number
as
begin
return 1;
end;
end trypa;
then I created a java file like this:
package test;
import java.io.*;
import java.util.*;
import conn.*;
import java.sql.*;
import oracle.jdbc.driver.*;
public class readData {
public static void main(String[] args) {
try {
Connect connPool = new Connect();
Connection myConn = connPool.getConnection();
CallableStatement cs = myConn.prepareCall("{?=call trypa.e(?)}");
cs.registerOutParameter(1,OracleTypes.NUMBER);
boolean b;
b = true;
cs.setBoolean(2,b);
cs.execute();
}
catch (Exception e)
{
System.out.println("error1£º"+e.getMessage());
}
}
}
But an error occured.
error1£ºORA-06550: µÚ 1 ÐÐ, µÚ 13 ÁÐ:
PLS-00306: µ÷Óà 'E' ʱ²ÎÊýÊýÁ¿»òÀ*ÐÍ´*Îó
ORA-06550: µÚ 1 ÐÐ, µÚ 7 ÁÐ:
PL/SQL: Statement ignored
I use Chinese Version. The error is parameter counts error or type error.
If I replace boolean to number, it works well.
How can I transfer a boolean variable?
Please help
thanks
ocean
-
Thanx
Sam
Life is a journey, not a destination!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|