Java External SP: Parameter styles
Java External SPs support 2 Parameter styles:
- Java(simple one 🙂
- Does not support “large objects” BLOB, CLOB,DBCLOB.
- Java method must be “public status void”
- INOUT and OUT parameters will be passed as single entry arrays.
- SQL IN = Java parameter (not array)
- SQL INOUT = Java ONE length array
- SQL OUT = Java ONE length array
- NULL are available/unavailable by the data type mapping.
- Other then this its there is nothing special on the Java side.
- Use following java code to get the JDBC connection:
- Connection con = DriverManager.getConnection(“jdbc:default:connection”);
- DB2GENERAL:
- Java class must implement ” com.ibm.db2.app.StoredProc ” class
- available in /QIBM/ProdData/OS400/Java400/ext/db2routines_classes.jar
- INOUT and OUT parameters are same as IN parameters
- NOT as single entry arrays.
- to populate the values in INOUT/OUT parameters use set() method from StoredProc class.
- NULL is allowed.
- isNull() can be used to check if value is null or not
- Does support “large objects” BLOB, CLOB,DBCLOB.
- Use following java code to get the JDBC connection:
- Connection con = getConnection(); // defined in StoredProc class
- Java class must implement ” com.ibm.db2.app.StoredProc ” class