Thread safety: the statement is not thread-safe. If the same statement is used by multiple threads access to it must be synchronized. The single synchronized block must include execution of the command and all operations with its result.
synchronized (stat) {
try (ResultSet rs = stat.executeQuery(queryString)) {
while (rs.next) {
// Do something
}
}
}
synchronized (stat) {
updateCount = stat.executeUpdate(commandString);
}
| Modifier and Type | Field and Description |
|---|---|
| private ArrayList | |
| private volatile boolean | |
| private boolean | |
| protected JdbcConnection | |
| private boolean | |
| private volatile CommandInterface | |
| protected int | |
| protected JdbcResultSet | |
| protected long | |
| protected JdbcResultSet | |
| protected final int | |
| protected final int | |
| protected Session | |
| protected long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addBatch(String
the SQL statement sql)Implements java. Adds a statement to the batch. |
| public void | |
| pack-priv void | |
| private static void | |
| public void | |
| public void | |
| public void | |
| pack-priv void | |
| private void | |
| protected void | |
| public void | closeOnCompletion()
Implements java. Specifies that this statement will be closed when its dependent result set is closed. |
| public String | Returns: specified identifier quoted if required, explicitly requested, or if it was already quotedidentifier to quote if required, may be quoted or unquoted identifier, boolean if alwaysQuote)true identifier will be quoted unconditionallyOverrides default java. Returns a SQL identifier. |
| public final boolean | Returns: true if result is a result set, false otherwisethe SQL statement to execute sql)Implements java. Executes a statement and returns type of its result. |
| public final boolean | Returns: true if result is a result set, false otherwisethe SQL statement sql, int Statement#RETURN_GENERATED_KEYS if generated keys should
be available for retrieval, Statement#NO_GENERATED_KEYS if
generated keys should not be availableImplements java. Executes a statement and returns type of its result. |
| public final boolean | Returns: true if result is a result set, false otherwisethe SQL statement sql, int[] an array of column indexes indicating the columns with generated
keys that should be returned from the inserted row columnIndexes)Implements java. Executes a statement and returns type of its result. |
| public final boolean | Returns: true if result is a result set, false otherwisethe SQL statement sql, String[] an array of column names indicating the columns with generated
keys that should be returned from the inserted row columnNames)Implements java. Executes a statement and returns type of its result. |
| public int[] | Returns: the array of update countsImplements java. Executes the batch. |
| private boolean | |
| public long[] | Returns: the array of update countsOverrides default java. Executes the batch. |
| public final long | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing)the SQL statement sql)Overrides default java. Executes a statement (insert, update, delete, create, drop) and returns the update count. |
| public final long | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing)the SQL statement sql, int Statement#RETURN_GENERATED_KEYS if generated keys should
be available for retrieval, Statement#NO_GENERATED_KEYS if
generated keys should not be availableOverrides default java. Executes a statement and returns the update count. |
| public final long | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing)the SQL statement sql, int[] an array of column indexes indicating the columns with generated
keys that should be returned from the inserted row columnIndexes)Overrides default java. Executes a statement and returns the update count. |
| public final long | Returns: the update count (number of row affected by an insert, update or delete, or 0 if no rows or the statement was a create, drop, commit or rollback)the SQL statement sql, String[] an array of column names indicating the columns with generated
keys that should be returned from the inserted row columnNames)Overrides default java. Executes a statement and returns the update count. |
| public ResultSet | Returns: the result setthe SQL statement to execute sql)Implements java. Executes a query (select statement) and returns the result set. |
| public final int | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, orSUCCESS_NO_INFO if number of rows is too large for the
int data type)the SQL statement sql)Implements java. Executes a statement (insert, update, delete, create, drop) and returns the update count. |
| public final int | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, orSUCCESS_NO_INFO if number of rows is too large for the
int data type)the SQL statement sql, int Statement#RETURN_GENERATED_KEYS if generated keys should
be available for retrieval, Statement#NO_GENERATED_KEYS if
generated keys should not be availableImplements java. Executes a statement and returns the update count. |
| public final int | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, orSUCCESS_NO_INFO if number of rows is too large for the
int data type)the SQL statement sql, int[] an array of column indexes indicating the columns with generated
keys that should be returned from the inserted row columnIndexes)Implements java. Executes a statement and returns the update count. |
| public final int | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, orSUCCESS_NO_INFO if number of rows is too large for the
int data type)the SQL statement sql, String[] an array of column names indicating the columns with generated
keys that should be returned from the inserted row columnNames)Implements java. Executes a statement and returns the update count. |
| private long | |
| public Connection | Returns: the connectionImplements java. Returns the connection that created this object. |
| public int | Returns: FETCH_FORWARDImplements java. Gets the fetch direction. |
| public int | Returns: the current fetch sizeImplements java. Gets the number of rows suggested to read in one step. |
| public final ResultSet | Returns: the possibly empty result set with generated keysImplements java. Return a result set with generated keys from the latest executed command
or an empty result set if keys were not generated or were not requested
with |
| public long | Returns: the number of rows where 0 means no limitOverrides default java. Gets the maximum number of rows for a ResultSet. |
| public final long | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or -1 if statement was a query)Overrides default java. Returns the last update count of this statement. |
| public int | Returns: always 0 for no limitImplements java. Gets the maximum number of bytes for a result set column. |
| public int | Returns: the number of rows where 0 means no limitImplements java. Gets the maximum number of rows for a ResultSet. |
| public boolean | Returns: falseImplements java. Moves to the next result set - however there is always only one result set. |
| public boolean | Returns: falseStatement.CLOSE_CURRENT_RESULT,
Statement.KEEP_CURRENT_RESULT,
or Statement.CLOSE_ALL_RESULTS current)Implements java. Move to the next result set. |
| public int | Returns: the timeout in secondsImplements java. Gets the current query timeout in seconds. |
| public ResultSet | Returns: the result setImplements java. Returns the last result set produces by this statement. |
| public int | Returns: the concurrencyImplements java. Gets the result set concurrency created by this object. |
| public int | Returns: the holdabilityImplements java. Gets the result set holdability. |
| public int | Returns: the typeImplements java. Gets the result set type. |
| public final int | Returns: the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or -1 if statement was a query, orSUCCESS_NO_INFO if number of
rows is too large for the int data type)Implements java. Returns the last update count of this statement. |
| public SQLWarning | Returns: nullImplements java. Gets the first warning reported by calls on this object. |
| public boolean | |
| public boolean | Returns: true if the statement is closedImplements java. Returns whether this statement is closed. |
| public boolean | Returns: true if this statement will be closed when its dependent
result set is closedImplements java. Returns whether this statement will be closed when its dependent result set is closed. |
| public boolean | Returns: falseImplements java. Returns whether this object is poolable. |
| public boolean | Returns: is specified identifier may be used without quotesidentifier to check identifier)Overrides default java. Retrieves whether |
| public boolean | Returns: whether or not the interface is assignable from this classthe class iface)Implements java. Checks if unwrap can return an object of this class. |
| pack-priv void | onLazyResultSetClose(CommandInterface
the command command, boolean whether to close the command closeCommand)Called when the result set is closed. |
| public void | setCursorName(String
ignored name)Implements java. Sets the name of the cursor. |
| public void | setEscapeProcessing(boolean
- true (default) or false (no conversion is attempted) enable)Implements java. Enables or disables processing or JDBC escape syntax. |
| pack-priv void | |
| public void | setFetchDirection(int
ignored direction)Implements java. Sets the fetch direction. |
| public void | setFetchSize(int
the number of rows rows)Implements java. Sets the number of rows suggested to read in one step. |
| public void | setLargeMaxRows(long
the number of rows where 0 means no limit maxRows)Overrides default java. Gets the maximum number of rows for a ResultSet. |
| public void | setMaxFieldSize(int
the maximum size - ignored max)Implements java. Sets the maximum number of bytes for a result set column. |
| public void | setMaxRows(int
the number of rows where 0 means no limit maxRows)Implements java. Gets the maximum number of rows for a ResultSet. |
| public void | setPoolable(boolean
the requested value poolable)Implements java. Requests that this object should be pooled or not. |
| public void | setQueryTimeout(int
the timeout in seconds - 0 means no timeout, values
smaller 0 will throw an exception seconds)Implements java. Sets the current query timeout in seconds. |
| public String | |
| public <T> T | Returns: thisthe class iface)Implements java. Return an object of this class if possible. |