8.4.1 List of the methods in the PreparedStatement interface
- Organization of this subsection
(1) Main functions of the PreparedStatement interface
The PreparedStatement interface provides the following main functions:
-
Execution of SQL statements in which dynamic parameters are specified
-
Specification of dynamic parameters
-
Generation and return of a ResultSet object as a retrieval result
-
Return of the number of updated rows as an updating result
Because the PreparedStatement interface is a subinterface of the Statement interface, it inherits all of the Statement interface functions.
(2) Methods in the PreparedStatement interface that are supported by HADB
The following table lists and describes the methods in the PreparedStatement interface that are supported by HADB.
No. |
Method in the PreparedStatement interface |
Function |
---|---|---|
1 |
Adds the current parameter set to this PreparedStatement object's batch. |
|
2 |
Clears all values from the current parameter set that is specified. |
|
3 |
Executes the preprocessed SQL statement. |
|
4 |
Executes a preprocessed SQL statement (other than a retrieval SQL statement) and returns the number of updated rows as long data. |
|
5 |
Executes a preprocessed retrieval SQL statement and returns the ResultSet object that contains the execution results. |
|
6 |
Executes a preprocessed SQL statement (other than a retrieval SQL statement) and returns the number of updated rows as int data. |
|
7 |
Acquires the SQL statement sequence number that is assigned to this PreparedStatement object. |
|
8 |
Acquires the statement handle that is assigned to this PreparedStatement object. |
|
9 |
Returns the ResultSetMetaData object that stores information about the columns in the ResultSet object that is returned when this PreparedStatement object is executed. |
|
10 |
Returns the ParameterMetaData object that contains meta information for the parameters in this PreparedStatement object. |
|
11 |
setAsciiStream(int parameterIndex, InputStream x, int length) |
Sets the value of a specified InputStream object as a dynamic parameter value. |
12 |
Sets a specified BigDecimal object as a dynamic parameter value. |
|
13 |
setBinaryStream(int parameterIndex, InputStream x, int length) |
Sets the value of a specified InputStream object as a dynamic parameter value. |
14 |
Sets a specified boolean value as a dynamic parameter value. |
|
15 |
Sets a specified byte value as a dynamic parameter value. |
|
16 |
Sets a specified byte array as a dynamic parameter value. |
|
17 |
setCharacterStream(int parameterIndex, Reader reader, int length) |
Sets a specified Reader object as a dynamic parameter value. |
18 |
Sets a specified java.sql.Date object as a dynamic parameter value. |
|
19 |
Converts a java.sql.Date object specified in local time to the equivalent value in a specified calendar's time zone, and then sets the resulting value as a dynamic parameter value. |
|
20 |
Sets a specified double value as a dynamic parameter value. |
|
21 |
Sets a specified float value as a dynamic parameter value. |
|
22 |
Sets a specified int value as a dynamic parameter value. |
|
23 |
Sets a specified long value as a dynamic parameter value. |
|
24 |
Sets the null value in a specified dynamic parameter. |
|
25 |
Sets the value of a specified object as a dynamic parameter value. |
|
26 |
||
27 |
setObject(int parameterIndex, Object x, int targetSqlType, int scale) |
|
28 |
Sets a specified short value as a dynamic parameter value. |
|
29 |
Sets a specified String object as a dynamic parameter value. |
|
30 |
Sets a specified java.sql.Time object as a dynamic parameter value. |
|
31 |
Converts a java.sql.Time object specified in local time to the equivalent value in a specified calendar's time zone, and then sets the resulting value as a dynamic parameter value. |
|
32 |
Sets a specified java.sql.Timestamp object as a dynamic parameter value. |
|
33 |
Converts a java.sql.Timestamp object specified in local time to the equivalent value in a specified calendar's time zone, and then sets the resulting value as a dynamic parameter value. |
- Important
-
HADB does not support methods that are not listed in this table. If an unsupported method is executed, an SQLException is thrown.
(3) Required package name and class name
The package and class names required in order to use the PreparedStatement interface are as follows:
-
Package name: com.hitachi.hadb.jdbc
-
Class name: AdbPreparedStatement