# PreparedStatementApi

interface PreparedStatementApi

Represents a precompiled SQL statement.

## Properties

fetchSize
Link copied to clipboard
abstract var fetchSize: Int?

The number of result set rows that should be fetched when generated by an executed statement.

resultSet
Link copied to clipboard
abstract val resultSet: ResultSet?

The ResultSet object generated by the executed statement, or `null` if none was retrieved.

timeout
Link copied to clipboard
abstract var timeout: Int?

The number of seconds the JDBC driver will wait for a statement to execute.

## Functions

addBatch
Link copied to clipboard
abstract fun addBatch()

Adds parameters to the statement's batch of SQL commands.

cancel
Link copied to clipboard
abstract fun cancel()

Cancels the statement, if supported by the database.

closeIfPossible
Link copied to clipboard
abstract fun closeIfPossible()

Closes the statement, if still open, and releases any of its database and/or driver resources.

executeBatch
Link copied to clipboard
abstract fun executeBatch(): List<Int>

Executes batched SQL statements stored as a PreparedStatement.

executeMultiple
Link copied to clipboard
abstract fun executeMultiple(): List<StatementResult>

Executes multiple SQL statements stored in a single PreparedStatement.

executeQuery
Link copied to clipboard
abstract fun executeQuery(): ResultSet

Executes an SQL query stored in a PreparedStatement.

executeUpdate
Link copied to clipboard
abstract fun executeUpdate(): Int

Executes an SQL statement stored in a PreparedStatement.

fillParameters
Link copied to clipboard
open fun fillParameters(args: Iterable<Pair<IColumnType<*>, Any?>>): Int

Sets the value for each column or expression in args into the appropriate statement parameter and returns the number of parameters filled.

set
Link copied to clipboard
abstract operator fun set(index: Int, value: Any)
setArray
Link copied to clipboard
abstract fun setArray(index: Int, type: String, array: Array<*>)

Sets the statement parameter at the index position to the provided array of SQL type.

setInputStream
Link copied to clipboard
abstract fun setInputStream(index: Int, inputStream: InputStream, setAsBlobObject: Boolean)

Sets the statement parameter at the index position to the provided inputStream, either directly as a BLOB if `setAsBlobObject` is `true` or as determined by the driver.

setNull
Link copied to clipboard
abstract fun setNull(index: Int, columnType: IColumnType<*>)

Sets the statement parameter at the index position to SQL NULL, if allowed wih the specified columnType.