I need to invoke an Oracle procedure with one IN parameter with VARCHAR2 and OUT parameter as BOOLEAN data type.
Below is my code using SimpleJdbcCall
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(getTemplate())
.withCatalogName("package_name")
.withProcedureName("proc_name")
.withoutProcedureColumnMetaDataAccess()
.declareParameters(
new SqlParameter ("userName", Types.VARCHAR),
new SqlOutParameter("status", Types.BOOLEAN)
);
Map<String, Object> inParams = new HashMap<String, Object>();
inParams .put("userName", userInput);
Map<String, Object> outputValue= jdbcCall.execute(inParams);
Exception : CallableStatementCallback; uncategorized SQLException for SQL [{call PACKAGE_NAME.PROC_NAME(?, ?)}]; SQL state [99999]; error code [17004]; Invalid column type: 16; nested exception is java.sql.SQLException: Invalid column type: 16
After doing a research i found that "JDBC drivers do not support the passing of Boolean parameters to PL/SQL stored procedures"
It has been suggested to wrap the PL/SQL procedure with a second PL/SQL procedure. The main problem is that i am restricted for write access in the db as that is client data. please help me to fix this issue.
Some of the links i referred
- https://docs.oracle.com/cd/F49540_01/DOC/java.815/a64685/tips3.htm
- https://community.oracle.com/thread/2139408?tstart=0
- https://community.oracle.com/thread/887712?tstart=0
- https://community.oracle.com/thread/975159?tstart=0
- Stored Function - Sending/Receiving Boolean - BD
- http://docs.oracle.com/cd/B28359_01/java.111/b31224/apxtblsh.htm#i1005380