Statement
interfacein packageklyn.databases.sql
public interface Statement extends AutoClosable:
└ Statement
SQL statement contract inspired by `java.sql.Statement`. Statement state is exposed through properties, while execution stays on a small verb-oriented surface: `query`, `update`, `execute`, `addBatch`.
import klyn.databases.sql

statement = connection.statement()
statement.fetchSize = 100
Properties
Modifier and Type Member Description
public readonly property batchSize
batchSize as Int
Number of statements currently queued in the batch.
public property closeOnCompletion
closeOnCompletion as Boolean
True when the statement auto-closes after completion.
public readonly property closed
closed as Boolean
True when the statement has been closed.
public readonly property concurrency
concurrency as ResultSetConcurrency
Result-set concurrency mode.
public readonly property connection
connection as Connection
Owning connection.
public property cursorName
cursorName as String
Optional cursor name.
public property escapeProcessing
escapeProcessing as Boolean
True when SQL escape processing is enabled.
public property fetchDirection
fetchDirection as FetchDirection
Preferred fetch direction.
public property fetchSize
fetchSize as Int
Preferred fetch size.
public readonly property generatedKeys
generatedKeys as ResultSet
Generated keys from the last update when supported by the driver.
public readonly property holdability
holdability as ResultSetHoldability
Result-set holdability mode.
public property largeMaxRows
largeMaxRows as Long
Max row count as `Long`, or `0` for unlimited.
public property maxFieldSize
maxFieldSize as Int
Max field size, or `0` for unlimited.
public property maxRows
maxRows as Int
Max rows returned by queries, or `0` for unlimited.
public property poolable
poolable as Boolean
True when the statement may participate in pooling.
public property queryTimeoutSeconds
queryTimeoutSeconds as Int
Query timeout in seconds.
public readonly property resultSetType
resultSetType as ResultSetType
Cursor scrollability mode.
public readonly property warning
warning as SQLWarning
Current warning chain.
Methods
Modifier and Type Member Description
public addBatch
addBatch(sql as String) as Void throws SQLException
Adds one SQL statement to the batch.
public clearBatch
clearBatch() as Void
Clears the queued batch.
public clearWarnings
clearWarnings() as Void
Clears the warning chain.
public execute
execute(sql as String) as Boolean throws SQLException
Executes arbitrary SQL.
public executeBatch
executeBatch() as ArrayList<Long> throws SQLException
Executes the queued batch.
public executeQuery
executeQuery(sql as String) as ResultSet throws SQLException
Java-compatible alias of `query(.
public executeUpdate
executeUpdate(sql as String) as Int throws SQLException
Java-compatible alias of `update(.
public query
query(sql as String) as ResultSet throws SQLException
Executes a query and returns a cursor.
public update
update(sql as String) as Long throws SQLException
Executes an update and returns the affected row count.
Methods inherited from AutoClosable: close