Hitachi

Hitachi Advanced Database Application Development Guide


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:

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.

Table 8‒13: Methods in the PreparedStatement interface

No.

Method in the PreparedStatement interface

Function

1

addBatch()

Adds the current parameter set to this PreparedStatement object's batch.

2

clearParameters()

Clears all values from the current parameter set that is specified.

3

execute()

Executes the preprocessed SQL statement.

4

executeLargeUpdate()

Executes a preprocessed SQL statement (other than a retrieval SQL statement) and returns the number of updated rows as long data.

5

executeQuery()

Executes a preprocessed retrieval SQL statement and returns the ResultSet object that contains the execution results.

6

executeUpdate()

Executes a preprocessed SQL statement (other than a retrieval SQL statement) and returns the number of updated rows as int data.

7

getHADBSQLSerialNum()

Acquires the SQL statement sequence number that is assigned to this PreparedStatement object.

8

getHADBStatementHandle()

Acquires the statement handle that is assigned to this PreparedStatement object.

9

getMetaData()

Returns the ResultSetMetaData object that stores information about the columns in the ResultSet object that is returned when this PreparedStatement object is executed.

10

getParameterMetaData()

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

setBigDecimal(int parameterIndex, BigDecimal x)

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

setBoolean(int parameterIndex, boolean x)

Sets a specified boolean value as a dynamic parameter value.

15

setByte(int parameterIndex, byte x)

Sets a specified byte value as a dynamic parameter value.

16

setBytes(int parameterIndex, byte[] x)

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

setDate(int parameterIndex, Date x)

Sets a specified java.sql.Date object as a dynamic parameter value.

19

setDate(int parameterIndex, Date x, Calendar cal)

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

setDouble(int parameterIndex, double x)

Sets a specified double value as a dynamic parameter value.

21

setFloat(int parameterIndex, float x)

Sets a specified float value as a dynamic parameter value.

22

setInt(int parameterIndex, int x)

Sets a specified int value as a dynamic parameter value.

23

setLong(int parameterIndex, long x)

Sets a specified long value as a dynamic parameter value.

24

setNull(int parameterIndex,int sqlType)

Sets the null value in a specified dynamic parameter.

25

setObject(int parameterIndex, Object x)

Sets the value of a specified object as a dynamic parameter value.

26

setObject(int parameterIndex, Object x, int targetSqlType)

27

setObject(int parameterIndex, Object x, int targetSqlType, int scale)

28

setShort(int parameterIndex, short x)

Sets a specified short value as a dynamic parameter value.

29

setString(int parameterIndex, String x)

Sets a specified String object as a dynamic parameter value.

30

setTime(int parameterIndex, Time x)

Sets a specified java.sql.Time object as a dynamic parameter value.

31

setTime(int parameterIndex, Time x, Calendar cal)

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

setTimestamp(int parameterIndex, Timestamp x)

Sets a specified java.sql.Timestamp object as a dynamic parameter value.

33

setTimestamp(int parameterIndex, Timestamp x, Calendar cal)

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: