OdbcCallableStatement
classin packageklyn.databases.sql.odbc
public class OdbcCallableStatement extends OdbcPreparedStatement implements CallableStatement
└ OdbcCallableStatement
All Implemented Interfaces: CallableStatement

ODBC callable statement.

Output parameters are bound through SQLBindParameter and read after execution. Klyn receives output values as text and the typed getXxx(...) methods perform the final conversion.

import klyn.databases.sql

# call = connection.callable("{ call refresh_cache(?, ?) }")
# call.setString(1, "users").out(2, Types.INTEGER)
# call.execute()
# print(call.getInt(2))
Properties
Modifier and Type Member Description
public readonly property outParameters
outParameters as SortedMap<Int, Int>
Declared output parameter SQL types.
public readonly property outValues
outValues as SortedMap<Int, Object>
Output values produced by this call.
Inherited Properties
propertyInherited Properties from OdbcPreparedStatement: parameterInfo, parameterMetadata, parameters, sql
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 override execute
execute() as Boolean throws SQLException
Executes the callable 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 getBoolean
getBoolean(index as Int) as Boolean throws SQLException
Reads one output parameter as Boolean.
public getDouble
getDouble(index as Int) as Double throws SQLException
Reads one output parameter as Double.
public getInt
getInt(index as Int) as Int throws SQLException
Reads one output parameter as Int.
public getLong
getLong(index as Int) as Long throws SQLException
Reads one output parameter as Long.
public getObject
getObject(index as Int) as Object throws SQLException
Reads one output parameter as an object.
public getString
getString(index as Int) as String throws SQLException
Reads one output parameter as text.
public out
out(index as Int, sqlType as Int, scale as Int = 0) as CallableStatement throws SQLException
Registers an output parameter.
public override query
query() as ResultSet throws SQLException
Executes the callable query.
public registerOutParameter
registerOutParameter(index as Int, sqlType as Int, scale as Int = 0) as CallableStatement throws SQLException
Registers an output parameter.
public override update
update() as Long throws SQLException
Executes the callable update.
public wasNull
wasNull() as Boolean throws SQLException
Returns true when the last output read returned SQL NULL.
Inherited Methods
methodInherited Methods from OdbcPreparedStatement: clearParameters, execute, query, set, setBoolean, setDouble, setInt, setLong, setNull, setString, update
methodInherited Methods from Statement: addBatch, clearBatch, clearWarnings, execute, executeBatch, executeQuery, executeUpdate, getResultSet
methodInherited Methods from AutoClosable: close