Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - |
Contents
Index
![]() ![]() |
Part 2 Developing Applications by APIs | > Chapter 9 Developing Java Applications | > 9.3 How to Use Java APIs | > 9.3.3 Updating Data |
Use the prepareDeleteRecordID method to delete data.
The Java APIs use record IDs to delete data. Before deleting data, use the getRecordID method to obtain the record IDs of the data items to be deleted.
The following diagram shows the process for deleting data by specifying a record ID.
ShunConnection con = new ShunConnection(); ShunPreparedRecordID prid = con.prepareDeleteRecordID(); (1) prid.add(recordID); (2) prid.deleteByRecordID(); (3) prid.close(); (4) con.close(); |
Use the prepareDeleteRecordID method to create a ShunPreparedRecordID object.
Use the add method to specify the record ID. Record IDs can be obtained using the getRecordID method.
Multiple record IDs can be specified with the add method. Any existing record IDs will be overwritten if they are specified again.
By specifying multiple record IDs with the add method, multiple XML documents can be obtained at once.
Execute the delete process using the deleteByRecordID method.
Use the close method of the ShunPreparedRecordID object to release the object when it is no longer required.
The following are entry examples available when Studio is used.
String recordID = dataBean.getDetailButton(); ShunConnection con = new ShunConnection(); ShunsakuAccessController controller = new ShunsakuAccessController(con); controller.delete(recordID); con.close(); |
public void delete(String recordID) throws ShunException { ShunPreparedRecordID prid = con.prepareDeleteRecordID(); (1) prid.add(recordID); (2) prid.deleteByRecordID(); (3) prid.close(); (4) } |
Contents
Index
![]() ![]() |