← Back to Stormify Documentation

Statement

A prepared SQL statement that supports parameter binding, execution, and batching.

Inheritors

Functions

Link copied to clipboard
abstract fun addBatch()

Adds the current set of parameters as a batch entry for later execution via executeBatch.

Link copied to clipboard
abstract fun executeBatch(): IntArray

Executes all batched statements and returns an array of update counts, one per batch entry.

Link copied to clipboard
abstract fun executeQuery(): ResultSet

Executes a SELECT statement and returns the result set.

Link copied to clipboard
abstract fun executeUpdate(): Int

Executes an INSERT, UPDATE, or DELETE statement and returns the number of affected rows.

Link copied to clipboard
abstract fun getGeneratedKeys(): ResultSet

Returns a result set containing any auto-generated keys produced by the last execution.

Link copied to clipboard
open fun reset()

Clears bound parameters and any pending batch entries so that this statement can be reused without re-preparing the SQL. Used by ORM-level prepared-statement caches that wish to keep the underlying server-side prepare across calls. Must be safe to call on a freshly opened statement (no-op). Default falls back to no-op so legacy implementations remain valid.

Link copied to clipboard
open fun setFetchSize(rows: Int)

Hint to the driver about how many rows to fetch per round-trip while iterating a ResultSet. JDBC pass-through on JVM. On native, positive values activate the driver's streaming path (single-row mode on PG, server-side cursors on MariaDB, prefetch-array sizing on Oracle). 0 leaves the driver default. Default no-op.

Link copied to clipboard
abstract fun setObject(parameterIndex: Int, value: Any?)

Binds a parameter value at the given 1-based parameterIndex.