Java External SP: Parameter styles

Java External SPs support 2 Parameter styles:

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

Leave a Reply

Your email address will not be published. Required fields are marked *