package com.sybase.jaguar.util; public class <object>Holder extends Object
For components that use the Jaguar-JDBC type mappings, holder classes are used to pass INOUT parameters to component method calls. Each holder class has a value field that contains instances of a specific object or base Java type.
Additional holder classes are defined in packages com.sybase.jaguar.util.jdbc102 and com.sybase.jaguar.util.jdbc11.
com.sybase.jaguar.util holder classes are summarized in the Table 1-2.
Holder class |
Datatype for value field |
Default for value |
---|---|---|
|
|
false |
|
|
0 |
|
|
null |
|
|
\u0000 (null character) |
|
|
0.0 |
|
|
0.0 |
|
|
0 |
|
|
0 |
|
|
0 |
|
|
null |
WARNING! Null parameter values are not supported. For StringHolder or BytesHolder parameters, use the constructor that takes an initial value, or set the value field explicitly.
<object>Holder()
Default constructor that assigns the default value specified in Table 1-2.
<object>Holder(<object> initialValue)
Constructor that takes an initial value specified as initialValue. initialValue is an instance of the appropriate datatype as specified in Table 1-2.
The current value contained by the holder object. Table 1-2 lists the datatypes and default values for the value field.
Java component methods on the server receive INOUT parameters as a holder object. The method should set the value field of each holder object before returning.
The examples below illustrate how to construct and use holder objects:
Each holder object has a default constructor that takes no arguments. For example:
StringHolder str_holder = new StringHolder(); IntegerHolder int_holder = new IntegerHolder();
Each holder object has an additional constructor that takes an initial value as a parameter. For example:
StringHolder str_holder = new StringHolder(“hello”); IntegerHolder int_holder = new IntegerHolder(43); float f = 3.141; FloatHolder float_holder = new FloatHolder(f);
Each holder object has a value member that allows access to the base object value. For example:
IntegerHolder i_hold = new IntegerHolder(); System.out.println( “IntegerHolder default value is:“ + i_hold.value);
jaguar.util.jdbc102.<object>Holder class, jaguar.util.jdbc11.<object>Holder class
Copyright © 2005. Sybase Inc. All rights reserved. |