PL/SQL Boolean Type in JDBC
Summary
PL/SQL Boolean Type in JDBCContent
We are looking for a way to handle PL/SQL Boolean type in stored procedures. PL/SQL Boolean type types can be present in below two ways within stored procedures -
1) Directly as a IN/OUT parameter e.g.
create or replace procedure boolean_proc(param1 in Boolean)
IS
BEGIN.......
2) As part of PL/SQL record type e.g.
create or replace package TEST_PKG is
type R_TYP is record(c1 boolean);
procedure REC_PROC(p1 in R_TYP, p2 OUT R_TYP);
end;..........
While calling such stored procedures, we need to map Java Boolean type i.e. "true" or "false" in case 1 and Java Integer type "0" or "other than 0" for second case while constructing Structs for Record. Is there any way to uniformly handle Boolean type in both cases?? Basically either use Java Boolean for both cases or use Java Integer for both cases. Any further suggestions??