This is my code to call procedure from java.
String DocumentSQL = "{call PKG_CREATE.PROC_CREATE_Claim(?,?)}";
callableStatement = connection.prepareCall(insertDocumentSQL);
callableStatement.setString(1,"Test");
callableStatement.setArray(2,claimArray);
Here I have used Oracle type Array. When claimArray has values its working fine. Sometimes it will be Null. So that I added like this
if(claimArray!=null){
callableStatement.setArray(2,claimArray);
}
else {
callableStatement.setArray(2,null);
or
callableStatement.setNull(2, OracleTypes.NULL);
}
It shows Error. How I can set Null Array?
callableStatement.setNull(2, java.sql.Types.ARRAY);?