CallableStatement

ldbc.sql.CallableStatement
trait CallableStatement[F[_]] extends PreparedStatement[F]

The interface used to execute SQL stored procedures. The JDBC API provides a stored procedure SQL escape syntax that allows stored procedures to be called in a standard way for all RDBMSs. This escape syntax has one form that includes a result parameter and one that does not. If used, the result parameter must be registered as an OUT parameter. The other parameters can be used for input, output or both. Parameters are referred to sequentially, by number, with the first parameter being 1.

 {?= call <procedure-name>[(<arg1>,<arg2>, ...)]}
 {call <procedure-name>[(<arg1>,<arg2>, ...)]}

IN parameter values are set using the set methods inherited from `[[PreparedStatement]]`. The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via the get methods provided here.

A CallableStatement can return one `[[ResultSet]]` object or multiple ResultSet objects. Multiple ResultSet objects are handled using operations inherited from `[[Statement]]`.

For maximum portability, a call's ResultSet objects and update counts should be processed prior to getting the values of output parameters.

Type parameters

F

the effect type

Attributes

Source
CallableStatement.scala
Graph
Supertypes
trait Statement[F]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def getBigDecimal(parameterIndex: Int): F[Option[BigDecimal]]

Retrieves the value of the designated JDBC NUMERIC parameter as a java.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.

Retrieves the value of the designated JDBC NUMERIC parameter as a java.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value in full precision. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getBigDecimal(parameterName: String): F[Option[BigDecimal]]

Retrieves the value of a JDBC NUMERIC parameter as a java.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.

Retrieves the value of a JDBC NUMERIC parameter as a java.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value in full precision. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getBoolean(parameterIndex: Int): F[Boolean]

Retrieves the value of the designated JDBC BIT or BOOLEAN parameter as a Boolean in the Sava programming language

Retrieves the value of the designated JDBC BIT or BOOLEAN parameter as a Boolean in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is false.

Source
CallableStatement.scala
def getBoolean(parameterName: String): F[Boolean]

Retrieves the value of a JDBC BIT or BOOLEAN parameter as a Boolean in the Sava programming language

Retrieves the value of a JDBC BIT or BOOLEAN parameter as a Boolean in the Sava programming language

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is false.

Source
CallableStatement.scala
def getByte(parameterIndex: Int): F[Byte]

Retrieves the value of the designated JDBC TINYINT parameter as a byte in the Sava programming language

Retrieves the value of the designated JDBC TINYINT parameter as a byte in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getByte(parameterName: String): F[Byte]

Retrieves the value of a JDBC TINYINT parameter as a byte in the Sava programming language

Retrieves the value of a JDBC TINYINT parameter as a byte in the Sava programming language

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getBytes(parameterIndex: Int): F[Option[Array[Byte]]]

Retrieves the value of the designated JDBC BINARY or VARBINARY parameter as an array of byte values in the Sava programming language

Retrieves the value of the designated JDBC BINARY or VARBINARY parameter as an array of byte values in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getBytes(parameterName: String): F[Option[Array[Byte]]]

Retrieves the value of a JDBC BINARY or VARBINARY parameter as an array of byte values in the Scala programming language.

Retrieves the value of a JDBC BINARY or VARBINARY parameter as an array of byte values in the Scala programming language.

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getDate(parameterIndex: Int): F[Option[LocalDate]]

Retrieves the value of the designated JDBC DATE parameter as a java.time.LocalDate object.

Retrieves the value of the designated JDBC DATE parameter as a java.time.LocalDate object.

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getDate(parameterName: String): F[Option[LocalDate]]

Retrieves the value of a JDBC DATE parameter as a java.sql.Date object.

Retrieves the value of a JDBC DATE parameter as a java.sql.Date object.

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getDouble(parameterIndex: Int): F[Double]

Retrieves the value of the designated JDBC DOUBLE parameter as a double in the Sava programming language

Retrieves the value of the designated JDBC DOUBLE parameter as a double in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getDouble(parameterName: String): F[Double]

Retrieves the value of a JDBC DOUBLE parameter as a double in the Sava programming language

Retrieves the value of a JDBC DOUBLE parameter as a double in the Sava programming language

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getFloat(parameterIndex: Int): F[Float]

Retrieves the value of the designated JDBC FLOAT parameter as a float in the Sava programming language

Retrieves the value of the designated JDBC FLOAT parameter as a float in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getFloat(parameterName: String): F[Float]

Retrieves the value of a JDBC FLOAT parameter as a float in the Sava programming language

Retrieves the value of a JDBC FLOAT parameter as a float in the Sava programming language

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getInt(parameterIndex: Int): F[Int]

Retrieves the value of the designated JDBC INTEGER parameter as an int in the Sava programming language

Retrieves the value of the designated JDBC INTEGER parameter as an int in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getInt(parameterName: String): F[Int]

Retrieves the value of a JDBC INTEGER parameter as an int in the Sava programming language

Retrieves the value of a JDBC INTEGER parameter as an int in the Sava programming language

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getLong(parameterIndex: Int): F[Long]

Retrieves the value of the designated JDBC BIGINT parameter as a long in the Sava programming language

Retrieves the value of the designated JDBC BIGINT parameter as a long in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getLong(parameterName: String): F[Long]

Retrieves the value of a JDBC BIGINT parameter as a long in the Sava programming language

Retrieves the value of a JDBC BIGINT parameter as a long in the Sava programming language

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getShort(parameterIndex: Int): F[Short]

Retrieves the value of the designated JDBC SMALLINT parameter as a short in the Sava programming language

Retrieves the value of the designated JDBC SMALLINT parameter as a short in the Sava programming language

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getShort(parameterName: String): F[Short]

Retrieves the value of a JDBC SMALLINT parameter as a short in the Sava programming language

Retrieves the value of a JDBC SMALLINT parameter as a short in the Sava programming language

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is 0.

Source
CallableStatement.scala
def getString(parameterIndex: Int): F[Option[String]]

Retrieves the value of the designated JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Sava programming language

Retrieves the value of the designated JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Sava programming language

For the fixed-length type JDBC CHAR, the String object returned has exactly the same value the SQL CHAR value had in the database, including any padding added by the database.

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getString(parameterName: String): F[Option[String]]

Retrieves the value of a JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Sava programming language

Retrieves the value of a JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Sava programming language

For the fixed-length type JDBC CHAR, the String object returned has exactly the same value the SQL CHAR value had in the database, including any padding added by the database.

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getTime(parameterIndex: Int): F[Option[LocalTime]]

Retrieves the value of the designated JDBC TIME parameter as a java.time.LocalTime object.

Retrieves the value of the designated JDBC TIME parameter as a java.time.LocalTime object.

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is null.

Source
CallableStatement.scala
def getTime(parameterName: String): F[Option[LocalTime]]

Retrieves the value of a JDBC TIME parameter as a java.sql.Time object.

Retrieves the value of a JDBC TIME parameter as a java.sql.Time object.

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is null.

Source
CallableStatement.scala
def getTimestamp(parameterIndex: Int): F[Option[LocalDateTime]]

Retrieves the value of the designated JDBC TIMESTAMP parameter as a java.time.LocalDateTime object.

Retrieves the value of the designated JDBC TIMESTAMP parameter as a java.time.LocalDateTime object.

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def getTimestamp(parameterName: String): F[Option[LocalDateTime]]

Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object.

Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object.

Value parameters

parameterName

the name of the parameter

Attributes

Returns

the parameter value. If the value is SQL NULL, the result is None.

Source
CallableStatement.scala
def registerOutParameter(parameterIndex: Int, sqlType: Int): F[Unit]

Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified by sqlType for an OUT parameter determines the Scala type that must be used in the get method to read the value of that parameter.

If the JDBC type expected to be returned to this output parameter is specific to this particular database, sqlType should be java.sql.Types.OTHER. The method [[#getObject]] retrieves the value.

Value parameters

parameterIndex

the first parameter is 1, the second is 2, and so on

sqlType

the JDBC type code defined by java.sql.Types. If the parameter is of JDBC type NUMERIC or DECIMAL, the version of registerOutParameter that accepts a scale value should be used.

Attributes

Source
CallableStatement.scala

Inherited methods

override def addBatch(sql: String): F[Unit]

Adds the given SQL command to the current list of commands for this Statement object. The commands in this list can be executed as a batch by calling the method executeBatch.

Adds the given SQL command to the current list of commands for this Statement object. The commands in this list can be executed as a batch by calling the method executeBatch.

Note:This method cannot be called on a PreparedStatement or CallableStatement.

Value parameters

sql

typically this is a SQL INSERT or UPDATE statement

Attributes

Definition Classes
Inherited from:
PreparedStatement
Source
PreparedStatement.scala

Inherited and Abstract methods

def addBatch(): F[Unit]

Adds a set of parameters to this PreparedStatement object's batch of commands.

Adds a set of parameters to this PreparedStatement object's batch of commands.

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def clearBatch(): F[Unit]

Empties this Statement object's current list of SQL commands.

Empties this Statement object's current list of SQL commands.

Attributes

Inherited from:
Statement
Source
Statement.scala
def close(): F[Unit]

Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed. It is generally good practice to release resources as soon as you are finished with them to avoid tying up database resources.

Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed. It is generally good practice to release resources as soon as you are finished with them to avoid tying up database resources.

Calling the method close on a Statement object that is already closed has no effect.

Note:When a Statement object is closed, its current ResultSet object, if one exists, is also closed.

Attributes

Inherited from:
Statement
Source
Statement.scala
def execute(): F[Boolean]

Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement. Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by the methods executeQuery and executeUpdate.

Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement. Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by the methods executeQuery and executeUpdate.

The execute method returns a boolean to indicate the form of the first result. You must call either the method getResultSet or getUpdateCount to retrieve the result; you must call getMoreResults to move to any subsequent result(s).

Attributes

Returns

true if the first result is a ResultSet object; false if the first result is an update count or there is no result

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def execute(sql: String, autoGeneratedKeys: Int): F[Boolean]

Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. The driver will ignore this signal if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. The driver will ignore this signal if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

Note:This method cannot be called on a PreparedStatement or CallableStatement.

Value parameters

autoGeneratedKeys

a constant indicating whether auto-generated keys should be made available for retrieval using the method getGeneratedKeys; one of the following constants: Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS

sql

any SQL statement

Attributes

Returns

true if the first result is a ResultSet object; false if it is an update count or there are no results

Inherited from:
Statement
Source
Statement.scala
def executeBatch(): F[Array[Int]]

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. The int elements of the array that is returned are ordered to correspond to the commands in the batch, which are ordered according to the order in which they were added to the batch. The elements in the array returned by the method executeBatch may be one of the following:

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. The int elements of the array that is returned are ordered to correspond to the commands in the batch, which are ordered according to the order in which they were added to the batch. The elements in the array returned by the method executeBatch may be one of the following:

  1. A number greater than or equal to zero -- indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
  2. A value of SUCCESS_NO_INFO -- indicates that the command was processed successfully but that the number of rows affected is unknown

    If one of the commands in a batch update fails to execute properly, this method throws a BatchUpdateException, and a JDBC driver may or may not continue to process the remaining commands in the batch. However, the driver's behavior must be consistent with a particular DBMS, either always continuing to process commands or never continuing to process commands. If the driver continues processing after a failure, the array returned by the method BatchUpdateException.getUpdateCounts will contain as many elements as there are commands in the batch, and at least one of the elements will be the following:

  3. A value of EXECUTE_FAILED -- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails

Attributes

Returns

an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.

Inherited from:
Statement
Source
Statement.scala

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. The long elements of the array that is returned are ordered to correspond to the commands in the batch, which are ordered according to the order in which they were added to the batch. The elements in the array returned by the method executeLargeBatch may be one of the following:

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. The long elements of the array that is returned are ordered to correspond to the commands in the batch, which are ordered according to the order in which they were added to the batch. The elements in the array returned by the method executeLargeBatch may be one of the following:

  1. A number greater than or equal to zero -- indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
  2. A value of SUCCESS_NO_INFO -- indicates that the command was processed successfully but that the number of rows affected is unknown

    If one of the commands in a batch update fails to execute properly, this method throws a BatchUpdateException, and a JDBC driver may or may not continue to process the remaining commands in the batch. However, the driver's behavior must be consistent with a particular DBMS, either always continuing to process commands or never continuing to process commands. If the driver continues processing after a failure, the array returned by the method BatchUpdateException.getLargeUpdateCounts will contain as many elements as there are commands in the batch, and at least one of the elements will be the following:

  3. A value of EXECUTE_FAILED -- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails

This method should be used when the returned row count may exceed Int.MaxValue.

The default implementation will throw UnsupportedOperationException

Attributes

Returns

an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.

Inherited from:
Statement
Source
Statement.scala

Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

This method should be used when the returned row count may exceed [[Integer#MAX_VALUE]].

The default implementation will throw UnsupportedOperationException

Attributes

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Inherited from:
PreparedStatement
Source
PreparedStatement.scala

Executes the specified SQL statement and returns one or more ResultSet objects.

Executes the specified SQL statement and returns one or more ResultSet objects.

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def executeUpdate(): F[Int]

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def executeUpdate(sql: String, autoGeneratedKeys: Int): F[Int]

Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. The driver will ignore the flag if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. The driver will ignore the flag if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

Note:This method cannot be called on a PreparedStatement or CallableStatement.

Value parameters

autoGeneratedKeys

a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS

sql

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

Attributes

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Inherited from:
Statement
Source
Statement.scala

Retrieves any auto-generated keys created as a result of executing this Statement object. If this Statement object did not generate any keys, an empty ResultSet object is returned.

Retrieves any auto-generated keys created as a result of executing this Statement object. If this Statement object did not generate any keys, an empty ResultSet object is returned.

Note:If the columns which represent the auto-generated keys were not specified, the JDBC driver implementation will determine the columns which best represent the auto-generated keys.

Attributes

Returns

a ResultSet object containing the auto-generated key(s) generated by the execution of this Statement object

Inherited from:
Statement
Source
Statement.scala

Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned. This method should be called only once per result.

Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned. This method should be called only once per result.

This method should be used when the returned row count may exceed [[Integer#MAX_VALUE]].

The default implementation will throw UnsupportedOperationException

Attributes

Returns

the current result as an update count; -1 if the current result is a ResultSet object or there are no more results

Inherited from:
Statement
Source
Statement.scala

Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.

Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.

There are no more results when the following is true: {{{ ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1)) }}}

Attributes

Returns

true if the next result is a ResultSet object; false if it is an update count or there are no more results

Inherited from:
Statement
Source
Statement.scala

Retrieves the current result as a ResultSet object. This method should be called only once per result.

Retrieves the current result as a ResultSet object. This method should be called only once per result.

Attributes

Returns

the current result as a ResultSet object or None if the result is an update count or there are no more results

Inherited from:
Statement
Source
Statement.scala
def getUpdateCount(): F[Int]

Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned. This method should be called only once per result.

Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned. This method should be called only once per result.

Attributes

Returns

the current result as an update count; -1 if the current result is a ResultSet object or there are no more results

Inherited from:
Statement
Source
Statement.scala
def isClosed(): F[Boolean]

Retrieves whether this Statement object has been closed. A Statement is closed if the method close has been called on it, or if it is automatically closed.

Retrieves whether this Statement object has been closed. A Statement is closed if the method close has been called on it, or if it is automatically closed.

Attributes

Returns

true if this Statement object is closed; false if it is still open

Inherited from:
Statement
Source
Statement.scala
def setBigDecimal(index: Int, value: BigDecimal): F[Unit]

Sets the designated parameter to the given Scala.math.BigDecimal value. The driver converts this to an SQL NUMERIC value when it sends it to the database.

Sets the designated parameter to the given Scala.math.BigDecimal value. The driver converts this to an SQL NUMERIC value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setBoolean(index: Int, value: Boolean): F[Unit]

Sets the designated parameter to the given Scala boolean value. The driver converts this to an SQL BIT or BOOLEAN value when it sends it to the database.

Sets the designated parameter to the given Scala boolean value. The driver converts this to an SQL BIT or BOOLEAN value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setByte(index: Int, value: Byte): F[Unit]

Sets the designated parameter to the given Scala byte value. The driver converts this to an SQL TINYINT value when it sends it to the database.

Sets the designated parameter to the given Scala byte value. The driver converts this to an SQL TINYINT value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setBytes(index: Int, value: Array[Byte]): F[Unit]

Sets the designated parameter to the given Scala array of bytes. The driver converts this to an SQL VARBINARY or LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARY values) when it sends it to the database.

Sets the designated parameter to the given Scala array of bytes. The driver converts this to an SQL VARBINARY or LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARY values) when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setDate(index: Int, value: LocalDate): F[Unit]

Sets the designated parameter to the given java.time.Date value, using the given Calendar object. The driver uses the Calendar object to construct an SQL DATE value, which the driver then sends to the database. With a Calendar object, the driver can calculate the date taking into account a custom timezone. If no Calendar object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.

Sets the designated parameter to the given java.time.Date value, using the given Calendar object. The driver uses the Calendar object to construct an SQL DATE value, which the driver then sends to the database. With a Calendar object, the driver can calculate the date taking into account a custom timezone. If no Calendar object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setDouble(index: Int, value: Double): F[Unit]

Sets the designated parameter to the given Scala double value. The driver converts this to an SQL DOUBLE value when it sends it to the database.

Sets the designated parameter to the given Scala double value. The driver converts this to an SQL DOUBLE value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setFloat(index: Int, value: Float): F[Unit]

Sets the designated parameter to the given Scala float value. The driver converts this to an SQL REAL value when it ends it to the database.

Sets the designated parameter to the given Scala float value. The driver converts this to an SQL REAL value when it ends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setInt(index: Int, value: Int): F[Unit]

Sets the designated parameter to the given Scala int value. The driver converts this to an SQL INTEGER value when it sends it to the database.

Sets the designated parameter to the given Scala int value. The driver converts this to an SQL INTEGER value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setLong(index: Int, value: Long): F[Unit]

Sets the designated parameter to the given Scala long value. The driver converts this to an SQL BIGINT value when it sends it to the database.

Sets the designated parameter to the given Scala long value. The driver converts this to an SQL BIGINT value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setNull(index: Int, sqlType: Int): F[Unit]

Sets the designated parameter to SQL NULL.

Sets the designated parameter to SQL NULL.

Value parameters

index

the first parameter is 1, the second is 2, ...

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setObject(parameterIndex: Int, value: Object): F[Unit]

Sets the value of the designated parameter using the given object.

Sets the value of the designated parameter using the given object.

The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument will be converted to the corresponding SQL type before being sent to the database.

Note that this method may be used to pass datatabase- specific abstract data types, by using a driver-specific Java type. If the object is of a class implementing the interface SQLData, the JDBC driver should call the method SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, NClob, Struct, java.net.URL, RowId, SQLXML or Array, the driver should pass it to the database as a value of the corresponding SQL type.

Note: Not all databases allow for a non-typed Null to be sent to the backend. For maximum portability, the setNull or the setObject(parameterIndex: Int, x: Object, sqlType: Int) method should be used instead of setObject(parameterIndex: Int, x: Object).

Note: This method throws an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of the interfaces named above.

Value parameters

parameterIndex

the first parameter is 1, the second is 2, ...

x

the object containing the input parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setShort(index: Int, value: Short): F[Unit]

Sets the designated parameter to the given Scala short value. The driver converts this to an SQL SMALLINT value when it sends it to the database.

Sets the designated parameter to the given Scala short value. The driver converts this to an SQL SMALLINT value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setString(index: Int, value: String): F[Unit]

Sets the designated parameter to the given Scala String value. The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends it to the database.

Sets the designated parameter to the given Scala String value. The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setTime(index: Int, value: LocalTime): F[Unit]

Sets the designated parameter to the given java.time.Time value. The driver converts this to an SQL TIME value when it sends it to the database.

Sets the designated parameter to the given java.time.Time value. The driver converts this to an SQL TIME value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala
def setTimestamp(index: Int, value: LocalDateTime): F[Unit]

Sets the designated parameter to the given java.time.Timestamp value. The driver converts this to an SQL TIMESTAMP value when it sends it to the database.

Sets the designated parameter to the given java.time.Timestamp value. The driver converts this to an SQL TIMESTAMP value when it sends it to the database.

Value parameters

index

the first parameter is 1, the second is 2, ...

value

the parameter value

Attributes

Inherited from:
PreparedStatement
Source
PreparedStatement.scala

Deprecated and Inherited methods

override def execute(sql: String): F[Boolean]

Executes the given SQL statement, which may return multiple results. In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

Executes the given SQL statement, which may return multiple results. In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

Note:This method cannot be called on a PreparedStatement or CallableStatement.

Value parameters

sql

any SQL statement

Attributes

Returns

true if the first result is a ResultSet object; false if it is an update count or there are no results

Deprecated
true
Definition Classes
Inherited from:
PreparedStatement
Source
PreparedStatement.scala
override def executeLargeUpdate(sql: String, autoGeneratedKeys: Int): F[Long]

Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. The driver will ignore the flag if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. The driver will ignore the flag if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

This method should be used when the returned row count may exceed [[Integer#MAX_VALUE]].

Note:This method cannot be called on a PreparedStatement or CallableStatement.

The default implementation will throw SQLFeatureNotSupportedException

Value parameters

autoGeneratedKeys

a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS

sql

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

Attributes

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Deprecated
true
Definition Classes
Inherited from:
PreparedStatement
Source
PreparedStatement.scala
override def executeLargeUpdate(sql: String): F[Long]

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

This method should be used when the returned row count may exceed [[Integer#MAX_VALUE]].

Note:This method cannot be called on a PreparedStatement or CallableStatement.

The default implementation will throw UnsupportedOperationException

Value parameters

sql

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

Attributes

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Deprecated
true
Definition Classes
Inherited from:
PreparedStatement
Source
PreparedStatement.scala
override def executeQuery(sql: String): F[ResultSet]

Executes the given SQL statement, which returns a single ResultSet object.

Executes the given SQL statement, which returns a single ResultSet object.

Note:This method cannot be called on a PreparedStatement or CallableStatement.

Value parameters

sql

an SQL statement to be sent to the database, typically a static SQL SELECT statement

Attributes

Returns

a ResultSet object that contains the data produced by the given query; never null

Deprecated
true
Definition Classes
Inherited from:
PreparedStatement
Source
PreparedStatement.scala
override def executeUpdate(sql: String): F[Int]

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

Note:This method cannot be called on a PreparedStatement or CallableStatement.

Value parameters

sql

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

Attributes

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Deprecated
true
Definition Classes
Inherited from:
PreparedStatement
Source
PreparedStatement.scala