Hitachi

Hitachi Advanced Database Application Development Guide


7.2 Basic procedure for application program processing

The following figure shows the basic procedure for using an application program to manipulate a database.

Figure 7‒1: Basic procedure for using an application program to manipulate a database

[Figure]

Explanation:
  1. Use the getConnection method of the DriverManager or DataSource class to connect to the HADB server. For details about how to connect to the HADB server, see 7.3 How to connect to the HADB server.

  2. Execute SQL statements to manipulate data. If you execute a SELECT statement, see 7.4 Retrieving data (executing the SELECT statement).

    If you execute an INSERT, UPDATE, or DELETE statement, see 7.5 Adding, updating, or deleting data (executing the INSERT, UPDATE, or DELETE statement).

  3. Use the close method of the Connection object to disconnect from the HADB server.

The JDBC API packages are explained in detail beginning from 8. The JDBC 1.2 API.

■ Notes about creating multithreaded applications

When all of the following conditions are met, a wait condition might arise due to serialization.

  • The application is designed to use multiple Statement objects created from the same Connection object in different threads.

  • SQL statements are executed concurrently using these Statement objects.

Because this wait condition occurs before the SQL statements are executed, it is not included in the timer monitoring time for the SQL execution processing. This means that a timeout error might not occur even if the timer monitoring time specified in the adb_clt_rpc_sql_wait_time property or by the setQueryTimeout method is exceeded.