/*Add code to retrieve the values and to save them*/
…
jdam.dam_freeBulkValue(objects);
hRowElem = jdam.dam_getNextValueSet(dam_hstmt);
}
3. Call dam_getBulkValueToSet that returns an array of objects (column values) and the number of rows to be inserted for the specified row element.
You must save the bulk information received from dam_getBulkValueToSet.
4. Obtain the next value set using dam_getNextValueSet. If the value returned is not null, repeat Steps 3 and 4 until all the values are retrieved.
5. For each row, based on the bulk information returned, retrieve the column values from the object array and type cast values to the required data type based on the type mapping, and then build the rows. Refer to Mapping SQL datatypes to Java datatypes for more information on type casting.
Note:Index the array to obtain any specific objects, while building the rows.
6. Insert rows to the data source and mark the row insert status of each row using the byte array returned by dam_getBulkRowStatusArray.
If a row is inserted successfully, its status is marked as DAM_ROW_SUCCESS. If the row is not inserted successfully, the status is marked as DAM_ROW_ERROR.
7. Free the object array that is returned by dam_getBulkValueToSet using dam_freeBulkValue.
The following code snippet illustrates how to obtain the object arrays from the columns.
while(hRowElem != 0)
{
hcol = jdam.dam_getColToSet(hRowElem);
...
/* Add code to save or store the object array to use it while building rows*/