Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX -
Contents Index PreviousNext

Part 1 The Basic for Developing Application> Chapter 6 Direct Access Function> 6.6 Updating Data by Direct Access Key

6.6.1 For Java API

The updateByKey method is used in the direct update for Java API.

The following figure shows the flow of the direct update for Java API.

[Figure 6-12 The flow of the direct update]

mark1Sample Code

ShunConnection con = new ShunConnection();

ShunPreparedKey preUkey = con.prepareUpdateKey("key1");                (1)
preUkey.add("20061101,00000001", updateData1);                         (2)
preUkey.add("20061101,00000002", updateData2);                         (2)
preUkey.add("20061101,00000003", updateData3);                         (2)
preUkey.setSearchType(ShunPreparedKey.SHUN_KEY_COMPLETE_MATCH);
preUkey.updateByKey();                                                 (3)
preUkey.close();                                                       (4)

con.close();

mark2(1) Create a ShunPreparedKey Object

Specify a direct access key name as parameters of the prepareUpdateKey method to create a ShunPreparedKey object.

mark2(2) Set the Direct Access Key and the Data to be Updated

Use the Add method to set the direct access key and the to be updated.

Multiple direct access keys and the update data can be set by using the add method.

Specifying multiple direct access keys and the update data with the add method to update multiple XML documents at a time.

mark2(3) Execute the Update

Use the updateByKey method to execute the update process.

mark2(4) Release the ShunPreparedKey Object

Use the close method of the ShunPreparedKey object to release the object when it is no longer required.

Refer to F.3.4 Update Data Using Direct Access Key for the sample program of the direct access.

Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006