Package com.ocient.jdbc
Class XGStatement
java.lang.Object
com.ocient.jdbc.XGStatement
- All Implemented Interfaces:
AutoCloseable,Statement,Wrapper
- Direct Known Subclasses:
XGPreparedStatement
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicBooleanprotected XGConnectionprotected final ArrayList<SQLException> protected booleanprotected booleanstatic final Loggerprotected booleanprotected booleanprotected XGResultSetprotected AtomicReference<SQLException> protected longprotected longprotected final ArrayList<SQLWarning> Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
ConstructorsConstructorDescriptionXGStatement(XGConnection conn) XGStatement(XGConnection conn, int type, int concur) XGStatement(XGConnection conn, int type, int concur, int hold) XGStatement(XGConnection conn, XGConnectionFactory connFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcancel()Kill the currently running queryvoidcancel(SQLException reason) Kill the currently running querycancelAsync(Optional<SQLException> reason) Interrupts result set processing and sends a KILL_QUERY opcode to the server.voidcancelQuery(String uuid) voidvoidvoidvoidclose()voidprotected voidDissociate the current query with this statementbooleanbooleanbooleanbooleanint[]executeInlinePlan(String plan) longexecuteLargeUpdate(String sql) executePlan(String plan) executeQuery(String sql) intexecuteUpdate(String sql) intexecuteUpdate(String sql, int autoGeneratedKeys) intexecuteUpdate(String sql, int[] columnIndexes) intexecuteUpdate(String sql, String[] columnNames) explain(String sql, ClientWireProtocol.ExplainFormat format) explainPipeline(String table) explainPlan(String plan, ClientWireProtocol.ExplainFormat format) exportCreatePipeline(String createPipeline) exportMlModel(String mlmodel) exportPipeline(String pipeline) exportTable(String table) exportTranslation(String table) exportView(String table) fetchSystemMetadataResultSet(ClientWireProtocol.FetchSystemMetadata.SystemMetadataCall call, String schema, String table, String col, boolean test, XGResultSet.Option... options) protected final voidfinalize()intintintintbooleanbooleangetMoreResults(int current) intprotected longintintintgetSql()intbooleanisClosed()booleanbooleanbooleanisWrapperFor(Class<?> iface) voidlistPlan()protected voidprotected voidlogQueryWithResults(XGResultSet result) <T> CompletableFuture<T> monitorTask(CompletableFuture<T> task) Monitors a task asspciated with the active query.static XGStatementnewXGStatement(XGConnection conn) Deprecated.static XGStatementnewXGStatement(XGConnection conn, boolean force, boolean oneShotForce) Deprecated.static XGStatementnewXGStatement(XGConnection conn, int type, int concur, boolean force, boolean oneShotForce) Deprecated.static XGStatementnewXGStatement(XGConnection conn, int type, int concur, int hold, boolean force, boolean oneShotForce) Deprecated.voidpassUpCancel(boolean clearCancelFlag) Force a redirect to the provided endpoint.protected CompletionStage<CompletableFutures.SQLResult<Void>> reset()voidsetCursorName(String name) voidsetEscapeProcessing(boolean enable) voidsetFetchDirection(int direction) voidsetFetchSize(int rows) voidstatic voidsetKMLFile(String cmd) voidsetMaxFieldSize(int max) voidsetMaxRows(int max) voidsetPoolable(boolean poolable) voidsetQueryTimeout(int seconds) toString()voidtransformNextResultSet(RowTransformerFactory rowTransformerFactory) <T> TMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, isSimpleIdentifier, setLargeMaxRows
-
Field Details
-
LOGGER
-
poolable
protected boolean poolable -
closed
-
conn
-
result
-
parms
-
timeTakenToCreateMillis
protected long timeTakenToCreateMillis -
warnings
-
errors
-
resultSetInterruptReason
-
force
protected boolean force -
forceNextRedirect
protected boolean forceNextRedirect -
timeoutMillis
protected volatile long timeoutMillis -
oneShotForce
protected boolean oneShotForce
-
-
Constructor Details
-
XGStatement
-
XGStatement
-
XGStatement
- Throws:
SQLException
-
XGStatement
- Throws:
SQLException
-
-
Method Details
-
setKMLFile
-
finalize
-
newXGStatement
Deprecated.This method is deprecated. Please fork the connection usingXGConnection.forkConnection(Hint, boolean)and use the publicXGStatement(XGConnection)constructor.- Parameters:
conn- the connection to forkoneShotForce-- Returns:
- Throws:
SQLException
-
newXGStatement
@Deprecated public static XGStatement newXGStatement(XGConnection conn, boolean force, boolean oneShotForce) throws SQLException Deprecated.This method is deprecated. Please fork the connection usingXGConnection.forkConnection(Hint, boolean)and use the publicXGStatement(XGConnection)constructor.- Parameters:
conn- the connection to forkforce- whether or not to disable redirectoneShotForce-- Returns:
- Throws:
SQLException
-
newXGStatement
@Deprecated public static XGStatement newXGStatement(XGConnection conn, int type, int concur, boolean force, boolean oneShotForce) throws SQLException Deprecated.This method is deprecated. Please fork the connection usingXGConnection.forkConnection(Hint, boolean)and use the publicXGStatement(XGConnection)constructor.- Parameters:
conn- the connection to forktype-concur-force-oneShotForce-- Returns:
- Throws:
SQLException
-
newXGStatement
@Deprecated public static XGStatement newXGStatement(XGConnection conn, int type, int concur, int hold, boolean force, boolean oneShotForce) throws SQLException Deprecated.This method is deprecated. Please fork the connection usingXGConnection.forkConnection(Hint, boolean)and use the publicXGStatement(XGConnection)constructor.- Parameters:
conn- the connection to forktype-concur-hold-force-oneShotForce-- Returns:
- Throws:
SQLException
-
transformNextResultSet
-
addBatch
- Specified by:
addBatchin interfaceStatement- Throws:
SQLException
-
redirect
Force a redirect to the provided endpoint. -
cancel
Kill the currently running query- Specified by:
cancelin interfaceStatement- Throws:
SQLException
-
cancel
Kill the currently running query- Throws:
SQLException
-
cancelAsync
Interrupts result set processing and sends a KILL_QUERY opcode to the server.- Returns:
- a future that completes with a boolean indicating whether an interrupt was performed or a SQLException.
-
cancelQuery
- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatchin interfaceStatement- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceStatement- Throws:
SQLException
-
clearErrors
- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Throws:
SQLException
-
closeAsync
-
closeResultSet
-
closeOnCompletion
- Specified by:
closeOnCompletionin interfaceStatement- Throws:
SQLException
-
dissociateQuery
protected void dissociateQuery()Dissociate the current query with this statement -
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
logQueryNoResults
protected void logQueryNoResults() -
logQueryWithResults
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Throws:
SQLException
-
executeInlinePlan
- Throws:
SQLException
-
executePlan
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
explain
- Throws:
SQLException
-
explainPlan
- Throws:
SQLException
-
exportPipeline
- Throws:
SQLException
-
exportCreatePipeline
- Throws:
SQLException
-
exportView
- Throws:
SQLException
-
exportTable
- Throws:
SQLException
-
exportTranslation
- Throws:
SQLException
-
exportMlModel
- Throws:
SQLException
-
explainPipeline
- Throws:
SQLException
-
fetchSystemMetadataInt
public CompletionStage<CompletableFutures.SQLResult<Integer>> fetchSystemMetadataInt(ClientWireProtocol.FetchSystemMetadata.SystemMetadataCall call) -
fetchSystemMetadataResultSet
public CompletionStage<CompletableFutures.SQLResult<ResultSet>> fetchSystemMetadataResultSet(ClientWireProtocol.FetchSystemMetadata.SystemMetadataCall call, String schema, String table, String col, boolean test, XGResultSet.Option... options) -
fetchSystemMetadataString
public CompletionStage<CompletableFutures.SQLResult<String>> fetchSystemMetadataString(ClientWireProtocol.FetchSystemMetadata.SystemMetadataCall call) -
getConnection
- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirectionin interfaceStatement- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceStatement- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeysin interfaceStatement- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
getQueryId
-
getQueryTimeout
- Specified by:
getQueryTimeoutin interfaceStatement- Throws:
SQLException
-
getQueryTimeoutMillis
protected long getQueryTimeoutMillis() -
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrencyin interfaceStatement- Throws:
SQLException
-
getResultSetHoldability
- Specified by:
getResultSetHoldabilityin interfaceStatement- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetTypein interfaceStatement- Throws:
SQLException
-
getSql
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceStatement- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceStatement- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletionin interfaceStatement- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolablein interfaceStatement- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
killQuery
- Throws:
SQLException
-
listPlan
- Throws:
SQLException
-
passUpCancel
- Throws:
SQLException
-
reset
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessingin interfaceStatement- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirectionin interfaceStatement- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolablein interfaceStatement- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeoutin interfaceStatement- Throws:
SQLException
-
setForceNextRedirect
public void setForceNextRedirect() -
monitorTask
Monitors a task asspciated with the active query. If the task does not complete within the specified timeout threshold, the query, and all of its dependent tasks, will be cancelled.- Parameters:
task- the task to execute- Returns:
- a new
CompletableFuturethat cancels the timer upon completion or the sameCompletableFutureif no timer was created.
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
toString
-