[Enterprise Extensions only]

ActiveX to EJB bridge, converting Java primitive data types

All primitive Java data types are automatically converted to native ActiveX Automation types. However, not all Automation data types are converted to Java types (for example, VT_DATE). Variant data types are used for data conversion. Variant data types are a requirement of any Automation interface, and are used automatically by Visual Basic and VBScript. The tables below provide details about how primitive data types are converted between Automation types and Java types.

ActiveX to Java primitive data type conversion

Visual Basic Type Variant Type Java Type Notes
Byte VT_I1 byte Byte in Visual Basic is unsigned, but is signed in Java. See Byte Helper Function.
Boolean VT_BOOL boolean  
Integer VT_I2 short  
Long VT_I4 int  
Currency VT_CY long See Currency Helper Function.
Single VT_R4 float  
Double VT_R8 double  
String VT_BSTR java.lang.String  
String VT_BSTR char For information about how chars are handled, see ActiveX to EJB bridge, calling Java methods and ActiveX to EJB bridge, accessing Java fields
Date VT_DATE n/a  


Java to ActiveX primitive data type conversion

Java Type Variant Type Visual Basic Type Notes
  • byte
  • java.lang.Byte
VT_I1 Byte Byte in Visual Basic is unsigned, but is signed in Java. See Byte Helper Function.
  • boolean
  • java.lang.Boolean
VT_BOOL Boolean  
  • short
  • java.lang.Short
VT_I2 Integer  
  • int
  • java.lang.Integer
VT_I4 Long  
  • long
  • java.lang.Long
VT_CY Currency  
  • float
  • java.lang.Float
VT_R4 Single  
  • double
  • java.lang.Double
VT_R8 Double  
  • java.lang.String
VT_BSTR String  
  • char
  • java.lang.Character
VT_BSTR String  
n/a VT_DATE Date Not available. java.util.Date objects are represented as normal Object Proxy objects.