ESQL-to-Java data-type mapping table

Table summarizing the mappings from ESQL to Java™.

The following table summarizes the mappings from ESQL to Java.
Notes:
  • Only the Java scalar wrappers are passed to Java.
  • 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. Each wrapper array contains exactly one element.
  • Scalar object wrappers are used to allow NULL values to be passed to and from Java methods.
ESQL data types 1 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 2 com.ibm.broker.plugin.MbTime com.ibm.broker.plugin.MbTime[]
GMTTIME 2 com.ibm.broker.plugin.MbTime com.ibm.broker.plugin.MbTime[]
TIMESTAMP 2 com.ibm.broker.plugin.MbTimestamp com.ibm.broker.plugin.MbTimestamp[]
GMTTIMESTAMP 2 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) 3 4 5 6 com.ibm.broker.plugin.MbElement com.ibm.broker.plugin.MbElement[] (Supported for INOUT. Not supported for OUT)
ROW Not supported Not supported
LIST Not supported Not supported
  1. Variables that are declared to be CONSTANT (or references to variables that are declared to be CONSTANT) are not allowed to have the direction INOUT or OUT.
  2. The time zone set in the Java variable is not important; you obtain the required time zone in the output ESQL.
  3. The reference parameter cannot be NULL when passed into a Java method.
  4. The reference cannot have the direction OUT when passed into a Java method.
  5. If an MbElement is passed back from Java to ESQL as an INOUT parameter, it must point to a location in the same message tree as that pointed to by the MbElement that was passed into the called Java method.

    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.

  6. An MbElement cannot be returned from a Java method with the RETURNS clause, because no ESQL routine can return a reference. However, an MbElement can be returned as an INOUT direction parameter, subject to the conditions described in point 5.

A REFERENCE to a scalar variable can be used in the CALL of a Java method, provided that the data type of the variable to which the reference refers matches the corresponding data type in the Java program signature.