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 prepareInsert method to add data.
The following diagram shows the process for adding data.
ShunConnection con = new ShunConnection();
con.close(); |
Use the prepareInsert method to create a ShunPreparedStatement object.
The following table shows the methods that can be used to add data.
Method |
Function |
---|---|
add(String data) |
Adds String object data. |
add(InputStream data) |
Adds InputStream object data. |
Multiple items of data can be specified with the add method. Also, data that is stored in multiple files can be added by invoking the add method multiple times. However, a single data item cannot be split into multiple segments and then specified in multiple instances of the add method.
Use the executeInsert method to add the data.
Use the close method of the ShunPreparedStatement object to release the object when it is no longer required.
The following are entry examples available when Studio is used.
ShunConnection con = new ShunConnection(); : ShunsakuAccessController controller = new ShunsakuAccessController(con); controller.insert(data); controller.close(); con.close(); |
public void insert(String data) throws ShunException { ShunPreparedStatement pstmti = fConnection.prepareInsert(); (1) pstmti.add(data); (2) pstmti.executeInsert(); (3) pstmti.close(); (4) } |
Contents
Index
![]() ![]() |