PreparedStatement
interfacein packageklyn.databases.sql
public interface PreparedStatement extends Statement:
└ PreparedStatement

Prepared SQL statement contract.

import klyn.databases.sql

prepared = connection.prepared("select * from users where id = ?")
prepared.setInt(1, 42)
Properties
Modifier and Type Member Description
public readonly property parameterInfo
parameterInfo as ParameterMetaData
Parameter metadata exposed as a property.
public readonly property parameterMetadata
parameterMetadata as ParameterMetaData
Alias exposing `parameterInfo` under a metadata-oriented name.
public readonly property parameters
parameters as Map<Int, Object>
Current bound parameters.
public readonly property sql
sql as String
Prepared SQL text.
Properties inherited from Statement: batchSize, closeOnCompletion, closed, concurrency, connection, cursorName, escapeProcessing, fetchDirection, fetchSize, generatedKeys, holdability, largeMaxRows, maxFieldSize, maxRows, poolable, queryTimeoutSeconds, resultSetType, warning
Methods
Modifier and Type Member Description
public clearParameters
clearParameters() as Void
Clears every parameter.
public execute
execute() as Boolean throws SQLException
Executes the prepared statement and reports whether a result set exists.
public query
query() as ResultSet throws SQLException
Executes the prepared query.
public set
set(index as Int, value as Object) as PreparedStatement throws SQLException
Sets one parameter value.
public setBoolean
setBoolean(index as Int, value as Boolean) as PreparedStatement throws SQLException
Sets a boolean parameter.
public setDouble
setDouble(index as Int, value as Double) as PreparedStatement throws SQLException
Sets a `Double` parameter.
public setInt
setInt(index as Int, value as Int) as PreparedStatement throws SQLException
Sets an `Int` parameter.
public setLong
setLong(index as Int, value as Long) as PreparedStatement throws SQLException
Sets a `Long` parameter.
public setNull
setNull(index as Int, sqlType as Int = Types.NULL) as PreparedStatement throws SQLException
Sets SQL `NULL`.
public setString
setString(index as Int, value as String) as PreparedStatement throws SQLException
Sets a `String` parameter.
public update
update() as Long throws SQLException
Executes the prepared update.
Methods inherited from Statement: addBatch, clearBatch, clearWarnings, execute, executeBatch, executeQuery, executeUpdate, getResultSet
Methods inherited from AutoClosable: close