com.mysql.cj

## Interface Query

All Known Subinterfaces:
  JdbcPreparedStatement, JdbcStatement, PreparedQuery

    public interface Query

### Nested Class Summary

Nested Classes
`static class` `Query.CancelStatus`

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addBatch(Object batch)`
`void` `checkCancelTimeout()`
`void` `clearBatchedArgs()`
`void` `closeQuery()`
`List<Object>` `getBatchedArgs()` Get the batched args as added by the addBatch method(s).
`Object` `getCancelTimeoutMutex()`
`String` `getCurrentDatabase()`
`long` `getExecuteTime()` Returns the elapsed time for the server to execute the query.
`int` `getId()` Returns the query id used when profiling
`QueryAttributesBindings` `getQueryAttributesBindings()`
`int` `getResultFetchSize()`
`<T extends Resultset,M extends Message> ProtocolEntityFactory<T,M>` `getResultSetFactory()`
`Resultset.Type` `getResultType()`
`Session` `getSession()`
`AtomicBoolean` `getStatementExecuting()`
`int` `getTimeoutInMillis()`
`boolean` `isClearWarningsCalled()`
`void` `resetCancelledState()`
`void` `setCancelStatus(Query.CancelStatus cs)`
`void` `setClearWarningsCalled(boolean clearWarningsCalled)`
`void` `setCurrentDatabase(String currentDb)`
`void` `setExecuteTime(long executeTime)`
`void` `setResultFetchSize(int fetchSize)`
`void` `setResultType(Resultset.Type resultSetType)`
`void` `setTimeoutInMillis(int timeoutInMillis)`
`CancelQueryTask` `startQueryTimer(Query stmtToCancel, int timeout)`
`void` `statementBegins()`
`void` `stopQueryTimer(CancelQueryTask timeoutTask, boolean rethrowCancelReason, boolean checkCancelTimeout)`

### Method Detail

#### getId

    int getId()

Returns the query id used when profiling

Returns:
  id

#### setCancelStatus

    void setCancelStatus(Query.CancelStatus cs)

#### checkCancelTimeout

    void checkCancelTimeout()

#### getResultSetFactory

    <T extends Resultset,M extends Message> ProtocolEntityFactory<T,M> getResultSetFactory()

#### getSession

    Session getSession()

#### getCancelTimeoutMutex

    Object getCancelTimeoutMutex()

#### resetCancelledState

    void resetCancelledState()

#### closeQuery

    void closeQuery()

#### addBatch

    void addBatch(Object batch)

#### getBatchedArgs

    List<Object> getBatchedArgs()

Get the batched args as added by the addBatch method(s). The list is unmodifiable and might contain any combination of String, ClientPreparedQueryBindings, or ServerPreparedQueryBindings depending on how the parameters were batched.

Returns:
  an unmodifiable List of batched args

#### clearBatchedArgs

    void clearBatchedArgs()

#### getQueryAttributesBindings

    QueryAttributesBindings getQueryAttributesBindings()

#### getResultFetchSize

    int getResultFetchSize()

#### setResultFetchSize

    void setResultFetchSize(int fetchSize)

#### getResultType

    Resultset.Type getResultType()

#### setResultType

    void setResultType(Resultset.Type resultSetType)

#### getTimeoutInMillis

    int getTimeoutInMillis()

#### setTimeoutInMillis

    void setTimeoutInMillis(int timeoutInMillis)

#### setExecuteTime

    void setExecuteTime(long executeTime)

#### getExecuteTime

    long getExecuteTime()

Returns the elapsed time for the server to execute the query.

Returns:
  the time it took for the server to execute the query.

#### startQueryTimer

    CancelQueryTask startQueryTimer(Query stmtToCancel,
                                    int timeout)

#### getStatementExecuting

    AtomicBoolean getStatementExecuting()

#### getCurrentDatabase

    String getCurrentDatabase()

#### setCurrentDatabase

    void setCurrentDatabase(String currentDb)

#### isClearWarningsCalled

    boolean isClearWarningsCalled()

#### setClearWarningsCalled

    void setClearWarningsCalled(boolean clearWarningsCalled)

#### statementBegins

    void statementBegins()

#### stopQueryTimer

    void stopQueryTimer(CancelQueryTask timeoutTask,
                        boolean rethrowCancelReason,
                        boolean checkCancelTimeout)

Copyright © 2016, 2023, Oracle and/or its affiliates.