Nonstop Database, HiRDB Version 9 UAP Development Guide
This section explains how to specify a value when using a repetition column as the ? parameter.
To specify a value for the ? parameter, use the setObject method to specify an object in the class in which the Array interface was installed or a column object.
Table 17-15 Object types returned during data acquisition using the Array.getArray() method without any argument
Data type returned by the Array.getBaseType method | Object types returned during data acquisition using the Array.getArray() method without any argument |
---|---|
java.sql.Types.INTEGER | int[] or java.lang.Integer[] |
java.sql.Types.SMALLINT | short[] or java.lang.Short[] |
java.sql.Types.DECIMAL | java.math.BigDecimal[] |
java.sql.Types.FLOAT | double[] or java.lang.Double[] |
java.sql.Types.REAL | float[] or java.lang.Float[] |
java.sql.Types.CHAR | java.lang.String[] |
java.sql.Types.VARCHAR | java.lang.String[] |
java.sql.Types.DATE | java.sql.Date[] |
java.sql.Types.TIME | java.sql.Time[] |
java.sql.Types.LONGVARBINARY | java.io.DataInputStream[] |
java.sql.Types.TIMESTAMP | java.sql.Timestamp[] |
Table 17-16 Data type of the SQL statement specified by the setObject method and the data type of the array object
Data type of the SQL statement specified by the setObject method | Data type of the array object |
---|---|
java.sql.Types.INTEGER | int[] or java.lang.Integer[] |
java.sql.Types.SMALLINT | short[] or java.lang.Short[] |
java.sql.Types.DECIMAL | java.math.BigDecimal[] |
java.sql.Types.FLOAT | double[] or java.lang.Double[] |
java.sql.Types.REAL | float[] or java.lang.Float[] |
java.sql.Types.CHAR | java.lang.String[] |
java.sql.Types.VARCHAR | java.lang.String[] |
java.sql.Types.DATE | java.sql.Date[] |
java.sql.Types.TIME | java.sql.Time[] |
java.sql.Types.LONGVARBINARY | java.io.DataInputStream[] |
java.sql.Types.TIMESTAMP | java.sql.Timestamp[] |
The sequence of the array objects obtained by the Array.getArray() method from the objects in the class in which the Array interface was installed is the same as the sequence of the repetition columns. Consequently, the first element of the array object becomes the first element of the repetition column, and the second element of the array object becomes the second element of the repetition column.
The same also holds true for the array objects specified by the setObject method. You can also specify an array object consisting of only one element.
Regardless of whether an object is in the class in which the Array interface was installed or an array object, if you specify a null value for an element in the middle of an element, the element of the applicable array becomes null. Therefore, to set a null value for the second element of a repetition column, specify a null value for the second element of the array object obtained by the Array.getArray() method from the objects in the class in which the Array interface was installed.
The same also holds true for the array objects specified by the setObject method.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.