Table of Contents Previous Next



Create the object types in the Advanced Server database. Object type addr_object_type defines the attributes of an address:
Object type emp_obj_typ defines the attributes of an employee. Note that one of these attributes is object type ADDR_OBJECT_TYPE as previously described. The object type body contains a method that displays the employee information:
A CallableStatement object is prepared based on the display_emp() method of the emp_obj_typ object type:
createStruct() initializes and creates instances of object types addr_object_type and emp_obj_typ named address and emp, respectively:
The call to registerOutParameter() registers the parameter type (Types.STRUCT) of emp_obj_typ:
The setObject() method binds the object instance emp to the IN OUT placeholder.
A call to stmt.execute() executes the call to the display_emp() method:
getObject() retrieves the emp_obj_typ object type. The attributes of the emp and address object instances are then retrieved and displayed:


Table of Contents Previous Next