ESQL to Java data type mapping

The following table summarizes the mappings from ESQL to Java.
Note:
  1. The Java scalar wrappers only are passed to Java.
  2. The ESQL scalar types are mapped to Java data types as object wrappers, or object wrapper arrays, depending upon the direction of the procedure parameter. The wrapper arrays are an array of exactly one element.
  3. Scalar object wrappers are used to allow NULL values to be passed to and from Java methods.
ESQL data types Java IN data types Java INOUT and OUT data types
INTEGER, INT java.lang.Long java.lang.Long []
FLOAT java.lang.Double java.lang.Double[]
DECIMAL java.math.BigDecimal java.math.BigDecimal[]
CHARACTER, CHAR java.lang.String java.lang.String[]
BLOB byte[] byte[][]
BIT java.util.BitSet java.util.BitSet[]
DATE com.ibm.broker.plugin.MbDate com.ibm.broker.plugin.MbDate[]
TIME com.ibm.broker.plugin.MbTime com.ibm.broker.plugin.MbTime[]
GMTTIME com.ibm.broker.plugin.MbTime com.ibm.broker.plugin.MbTime[]
TIMESTAMP com.ibm.broker.plugin.MbTimestamp com.ibm.broker.plugin.MbTimestamp[]
GMTTIMESTAMP com.ibm.broker.plugin.MbTimestamp com.ibm.broker.plugin.MbTimestamp[]
INTERVAL Not supported Not supported
BOOLEAN java.lang.Boolean java.lang.Boolean[]
REFERENCE (to a message tree) com.ibm.broker.plugin.MbElement com.ibm.broker.plugin.MbElement[] (Supported for INOUT Not supported for OUT)
REFERENCE (to a scalar variable) Supported, provided that the data type of the variable it refers to matches the corresponding data type in the Java program signature Supported, provided that the data type of the variable it refers to matches the corresponding data type in the Java program signature
Note: If you are using the ESQL REFERENCE data type with Java, note the following:
  1. The type cannot be NULL when passed into a Java method.
  2. If an MbElement is passed back from Java to ESQL as an INOUT parameter, the MbElement passed back must point to a location in the same message tree as the MbElement did when it was passed into the Java method when called.

    For example, if an ESQL REFERENCE to OutputRoot.XML.Test is passed into a Java method as an INOUT MbElement, but a different MbElement is passed back to ESQL when the call returns, the different element must also point to somewhere in the OutputRoot tree.

  3. The reference cannot have the direction OUT when passed to Java
  4. MbElements cannot be returned from a Java method with the RETURNS clause as no ESQL function or procedure can RETURN a REFERENCE. However, MbElemnts can be returned as INOUT direction parameters, subject to the conditions described in point two above.
  5. The time zone set in the Java variable is not important; you obtain the required time zone in the output ESQL.
  6. Variables that are declared to be CONSTANT (or references to variables declared to be CONSTANT) are not allowed to have the direction INOUT or OUT.
Related reference
CREATE PROCEDURE statement