OdbcPreparedStatement
classin packageklyn.databases.sql.odbc
public class OdbcPreparedStatement extends OdbcStatementBase implements PreparedStatement
OdbcPreparedStatement
All Implemented Interfaces: PreparedStatement

ODBC prepared statement.

Parameters are bound through the native ODBC API. Numeric values retain their signed, unsigned or floating C representation. Text and temporal values use textual binding with an explicit SQL target type.

import klyn.databases.sql

# prepared = connection.prepared("select * from users where id = ?")
# prepared.setInt(1, 42)
# rows = prepared.query()
Properties
Modifier and Type Member Description
public readonly property parameterInfo
parameterInfo as ParameterMetaData
Parameter metadata.
public readonly property parameterMetadata
parameterMetadata as ParameterMetaData
Parameter metadata alias.
public readonly property parameters
parameters as SortedMap<Int, Object>
Current bound parameter values.
public readonly property sql
sql as String
Prepared SQL text.
Inherited Properties
propertyInherited Properties 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 bound parameter.
public execute
execute() as Boolean throws SQLException
Executes the prepared statement.
public override execute
execute(sql as String) as Boolean throws SQLException
Executes arbitrary SQL through the underlying statement API.
public override executeQuery
executeQuery(sql as String) as ResultSet throws SQLException
Executes arbitrary query SQL through the underlying statement API.
public override executeUpdate
executeUpdate(sql as String) as Int throws SQLException
Executes arbitrary update SQL through the underlying statement API.
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 one boolean parameter.
public setDouble
setDouble(index as Int, value as Double) as PreparedStatement throws SQLException
Sets one Double parameter.
public setInt
setInt(index as Int, value as Int) as PreparedStatement throws SQLException
Sets one Int parameter.
public setLong
setLong(index as Int, value as Long) as PreparedStatement throws SQLException
Sets one Long parameter.
public setNull
setNull(index as Int, sqlType as Int = Types.NULL) as PreparedStatement throws SQLException
Sets one parameter to SQL NULL.
public setString
setString(index as Int, value as String) as PreparedStatement throws SQLException
Sets one text parameter.
public update
update() as Long throws SQLException
Executes the prepared update.
Inherited Methods
methodInherited Methods from Statement: addBatch, clearBatch, clearWarnings, execute, executeBatch, executeQuery, executeUpdate, getResultSet
methodInherited Methods from AutoClosable: close