public class OdbcPreparedStatement extends OdbcStatementBase implements 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()| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | parameterInfoparameterInfo as ParameterMetaData: |
Parameter metadata. |
| public readonly property | parameterMetadataparameterMetadata as ParameterMetaData: |
Parameter metadata alias. |
| public readonly property | parameters | Current bound parameter values. |
| public readonly property | sqlsql as String: |
Prepared SQL text. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | clearParametersclearParameters() as Void: |
Clears every bound parameter. |
| public | executeexecute() as Boolean throws SQLException: |
Executes the prepared statement. |
| public | executeexecute(sql as String) as Boolean throws SQLException: |
Executes arbitrary SQL through the underlying statement API. |
| public | executeQueryexecuteQuery(sql as String) as ResultSet throws SQLException: |
Executes arbitrary query SQL through the underlying statement API. |
| public | executeUpdateexecuteUpdate(sql as String) as Int throws SQLException: |
Executes arbitrary update SQL through the underlying statement API. |
| public | queryquery() as ResultSet throws SQLException: |
Executes the prepared query. |
| public | setset(index as Int, value as Object) as PreparedStatement throws SQLException: |
Sets one parameter value. |
| public | setBooleansetBoolean(index as Int, value as Boolean) as PreparedStatement throws SQLException: |
Sets one boolean parameter. |
| public | setDoublesetDouble(index as Int, value as Double) as PreparedStatement throws SQLException: |
Sets one Double parameter. |
| public | setIntsetInt(index as Int, value as Int) as PreparedStatement throws SQLException: |
Sets one Int parameter. |
| public | setLongsetLong(index as Int, value as Long) as PreparedStatement throws SQLException: |
Sets one Long parameter. |
| public | setNullsetNull(index as Int, sqlType as Int = Types.NULL) as PreparedStatement throws SQLException: |
Sets one parameter to SQL NULL. |
| public | setStringsetString(index as Int, value as String) as PreparedStatement throws SQLException: |
Sets one text parameter. |
| public | updateupdate() as Long throws SQLException: |
Executes the prepared update. |