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.5 Deleting Data by Direct Access Key

6.5.1 For Java API

The deleteByKey method is used in the direct deletion for Java API.

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

[Figure 6-8 The Flow of the Direct Deletion]

mark1Sample Code

ShunConnection con = new ShunConnection();

ShunPreparedKey preDkey = con.prepareDeleteKey("key1");           (1)
preDkey.add("20061101,00000001");                                 (2)
preDkey.add("20061101,00000002");                                 (2)
preDkey.add("20061101,00000003");                                 (2)
preDkey.setSearchType(ShunPreparedKey.SHUN_KEY_COMPLETE_MATCH);
preDkey.deleteByKey();                                            (3)
preDkey.close();                                                  (4)

con.close();

mark2(1) Create a ShunPreparedKey Object

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

mark2(2) Set the Direct Access Key

Use the Add method to set the direct access key.

Multiple direct access keys can be set by using add method.

Specify multiple direct access keys with the add method to delete multiple XML documents at a time.

mark2(3) Delete the Data

Execute the delete process using the deleteByKey method.

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.3 Delete Data Using Direct Access Key for the sample program of the direct access.

Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006