public abstract class AvaticaStatement extends Object implements Statement
Statement
for the Avatica engine.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected boolean |
closeOnCompletion
Support for
closeOnCompletion() method. |
AvaticaConnection |
connection |
Meta.StatementHandle |
handle
Statement id; unique within connection.
|
protected int |
maxRowCount |
protected AvaticaResultSet |
openResultSet
Current result set, or null if the statement is not executing anything.
|
protected int |
updateCount
Current update count.
|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO| Modifier | Constructor and Description |
|---|---|
protected |
AvaticaStatement(AvaticaConnection connection,
Meta.StatementHandle h,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates an AvaticaStatement.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch(String sql) |
void |
cancel() |
void |
clearBatch() |
void |
clearWarnings() |
protected void |
close_() |
void |
close() |
void |
closeOnCompletion() |
boolean |
execute(String sql) |
boolean |
execute(String sql,
int autoGeneratedKeys) |
boolean |
execute(String sql,
int[] columnIndexes) |
boolean |
execute(String sql,
String[] columnNames) |
int[] |
executeBatch() |
protected boolean |
executeInternal(Meta.Signature signature)
Executes a prepared statement.
|
protected void |
executeInternal(String sql) |
ResultSet |
executeQuery(String sql) |
protected ResultSet |
executeQueryInternal(Meta.Signature signature)
Executes a prepared query, closing any previously open result set.
|
int |
executeUpdate(String sql) |
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
int |
executeUpdate(String sql,
int[] columnIndexes) |
int |
executeUpdate(String sql,
String[] columnNames) |
protected List<Object> |
getBoundParameterValues()
Returns a list of bound parameter values.
|
AvaticaConnection |
getConnection() |
int |
getFetchDirection() |
int |
getFetchSize() |
ResultSet |
getGeneratedKeys() |
int |
getId()
Returns the identifier of the statement, unique within its connection.
|
int |
getMaxFieldSize() |
int |
getMaxRows() |
boolean |
getMoreResults() |
boolean |
getMoreResults(int current) |
protected List<Object> |
getParameterValues()
Returns the list of values of this statement's parameters.
|
int |
getQueryTimeout() |
ResultSet |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
int |
getUpdateCount() |
SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isCloseOnCompletion() |
boolean |
isPoolable() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setCursorName(String name) |
void |
setEscapeProcessing(boolean enable) |
void |
setFetchDirection(int direction) |
void |
setFetchSize(int rows) |
void |
setMaxFieldSize(int max) |
void |
setMaxRows(int maxRowCount) |
void |
setPoolable(boolean poolable) |
void |
setQueryTimeout(int seconds) |
<T> T |
unwrap(Class<T> iface) |
public final AvaticaConnection connection
public final Meta.StatementHandle handle
protected boolean closed
protected boolean closeOnCompletion
closeOnCompletion() method.protected AvaticaResultSet openResultSet
protected int updateCount
openResultSet.protected int maxRowCount
protected AvaticaStatement(AvaticaConnection connection, Meta.StatementHandle h, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
connection - Connectionh - Statement handleresultSetType - Result set typeresultSetConcurrency - Result set concurrencyresultSetHoldability - Result set holdabilitypublic int getId()
protected void executeInternal(String sql) throws SQLException
SQLExceptionpublic boolean execute(String sql) throws SQLException
execute in interface StatementSQLExceptionpublic ResultSet executeQuery(String sql) throws SQLException
executeQuery in interface StatementSQLExceptionpublic int executeUpdate(String sql) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface StatementSQLExceptionprotected void close_()
public int getMaxFieldSize()
throws SQLException
getMaxFieldSize in interface StatementSQLExceptionpublic void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize in interface StatementSQLExceptionpublic int getMaxRows()
getMaxRows in interface Statementpublic void setMaxRows(int maxRowCount)
throws SQLException
setMaxRows in interface StatementSQLExceptionpublic void setEscapeProcessing(boolean enable)
throws SQLException
setEscapeProcessing in interface StatementSQLExceptionpublic int getQueryTimeout()
throws SQLException
getQueryTimeout in interface StatementSQLExceptionpublic void setQueryTimeout(int seconds)
throws SQLException
setQueryTimeout in interface StatementSQLExceptionpublic void cancel()
throws SQLException
cancel in interface StatementSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface StatementSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings in interface StatementSQLExceptionpublic void setCursorName(String name) throws SQLException
setCursorName in interface StatementSQLExceptionpublic ResultSet getResultSet() throws SQLException
getResultSet in interface StatementSQLExceptionpublic int getUpdateCount()
throws SQLException
getUpdateCount in interface StatementSQLExceptionpublic boolean getMoreResults()
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic void setFetchDirection(int direction)
throws SQLException
setFetchDirection in interface StatementSQLExceptionpublic int getFetchDirection()
getFetchDirection in interface Statementpublic void setFetchSize(int rows)
throws SQLException
setFetchSize in interface StatementSQLExceptionpublic int getFetchSize()
getFetchSize in interface Statementpublic int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency in interface StatementSQLExceptionpublic int getResultSetType()
throws SQLException
getResultSetType in interface StatementSQLExceptionpublic void addBatch(String sql) throws SQLException
addBatch in interface StatementSQLExceptionpublic void clearBatch()
throws SQLException
clearBatch in interface StatementSQLExceptionpublic int[] executeBatch()
throws SQLException
executeBatch in interface StatementSQLExceptionpublic AvaticaConnection getConnection()
getConnection in interface Statementpublic boolean getMoreResults(int current)
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
getGeneratedKeys in interface StatementSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, String[] columnNames) throws SQLException
execute in interface StatementSQLExceptionpublic int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLExceptionpublic boolean isClosed()
throws SQLException
isClosed in interface StatementSQLExceptionpublic void setPoolable(boolean poolable)
throws SQLException
setPoolable in interface StatementSQLExceptionpublic boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLExceptionpublic void closeOnCompletion()
throws SQLException
closeOnCompletion in interface StatementSQLExceptionpublic boolean isCloseOnCompletion()
throws SQLException
isCloseOnCompletion in interface StatementSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionprotected boolean executeInternal(Meta.Signature signature) throws SQLException
signature - Parsed statementStatement.execute(String)SQLException - if a database error occursprotected ResultSet executeQueryInternal(Meta.Signature signature) throws SQLException
signature - Parsed querySQLException - if a database error occursprotected List<Object> getParameterValues()
Called at execute time. Not a public API.
The default implementation returns the empty list, because non-prepared statements have no parameters.
protected List<Object> getBoundParameterValues() throws SQLException
If any of the parameters have not been bound, throws. If parameters have been bound to null, the value in the list is null.
SQLExceptionCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.