A statement is an object that represents a precompiled SQL statement.
Type parameters
- F
-
The effect type
Attributes
- Companion
- object
- Source
- Statement.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Abstract methods
Holds batched commands
Releases this Statement object's database and LDBC 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 LDBC 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
- 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 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:
- 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
- A value of
SUCCESS_NO_INFO
-- indicates that the command was processed successfully but that the number of rows affected is unknownIf 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 methodBatchUpdateException.getUpdateCounts
will contain as many elements as there are commands in the batch, and at least one of the elements will be the following: - 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.
- Source
- Statement.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.
Value parameters
- sql
-
an SQL statement to be sent to the database, typically a static SQL SELECT statement
Attributes
- Source
- Statement.scala
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
- Source
- Statement.scala
Retrieves any auto-generated keys created as a result of executing this Statement object.
Retrieves any auto-generated keys created as a result of executing this Statement object.
Attributes
- Source
- Statement.scala
Concrete methods
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.
Value parameters
- sql
-
typically this is a SQL INSERT or UPDATE statement
Attributes
- Source
- Statement.scala
Empties this Statement object's current list of SQL commands.