Top Fields Constructors Methods
com.mysql.cj

public abstract Class AbstractQuery

extends Object
implements Query
Class Inheritance
All Implemented Interfaces
com.mysql.cj.Query
Known Direct Subclasses
com.mysql.cj.ClientPreparedQuery, com.mysql.cj.SimpleQuery
Imports
java.util.ArrayList, .Collections, .List, java.util.concurrent.atomic.AtomicBoolean, java.util.concurrent.locks.Lock, .ReentrantLock, com.mysql.cj.conf.PropertyKey, .RuntimeProperty, com.mysql.cj.exceptions.CJException, .CJTimeoutException, .ExceptionFactory, .OperationCancelledException, com.mysql.cj.protocol.Message, .ProtocolEntityFactory, .Resultset, .Resultset.Type

Field Summary

Modifier and TypeField and Description
protected List<Object>
batchedArgs

Holds batched commands

private Query.CancelStatus
protected Lock
cancelTimeoutLock

Lock to prevent race between returning query results and noticing that query has been timed-out or cancelled.

protected String
charEncoding

The character encoding to use (if available)

protected boolean
clearWarningsCalled

Has clearWarnings() been called?

protected String
currentDb

The database in use

private long
executeTime

Elapsed time of the execution

protected int
fetchSize

The number of rows to fetch at a time (currently ignored)

protected final Lock
protected RuntimeProperty<Integer>
protected QueryAttributesBindings
queryAttributesBindings

Query attributes bindings

protected Resultset.Type
resultSetType

The type of this result set (scroll sensitive or in-sensitive)

public NativeSession
pack-priv static int
statementCounter

Used to generate IDs when profiling.

protected final AtomicBoolean
statementExecuting

Currently executing a statement?

protected int
statementId

Used to identify this statement when profiling.

protected long
timeoutInMillis

The timeout for a query

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
public List<Object>
getBatchedArgs()

Implements com.mysql.cj.Query.getBatchedArgs.

Get the batched args as added by the addBatch method(s).

public Lock
public String
public long
getExecuteTime()

Implements com.mysql.cj.Query.getExecuteTime.

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

public int
getId()

Implements com.mysql.cj.Query.getId.

Returns the query id used when profiling

public QueryAttributesBindings
public int
public <T extends Resultset, M extends Message> ProtocolEntityFactory<T, M>
public Resultset.Type
public NativeSession
public AtomicBoolean
public long
public boolean
public void
public void
public void
setClearWarningsCalled(boolean clearWarningsCalled)

Implements com.mysql.cj.Query.setClearWarningsCalled.

public void
public void
public void
public void
public void
public CancelQueryTask
startQueryTimer(Query stmtToCancel, long timeout)

Implements com.mysql.cj.Query.startQueryTimer.

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

Implements com.mysql.cj.Query.stopQueryTimer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

batchedArgsback to summary
protected List<Object> batchedArgs

Holds batched commands

cancelStatusback to summary
private Query.CancelStatus cancelStatus
cancelTimeoutLockback to summary
protected Lock cancelTimeoutLock

Lock to prevent race between returning query results and noticing that query has been timed-out or cancelled.

charEncodingback to summary
protected String charEncoding

The character encoding to use (if available)

clearWarningsCalledback to summary
protected boolean clearWarningsCalled

Has clearWarnings() been called?

currentDbback to summary
protected String currentDb

The database in use

executeTimeback to summary
private long executeTime

Elapsed time of the execution

fetchSizeback to summary
protected int fetchSize

The number of rows to fetch at a time (currently ignored)

lockback to summary
protected final Lock lock
maxAllowedPacketback to summary
protected RuntimeProperty<Integer> maxAllowedPacket
queryAttributesBindingsback to summary
protected QueryAttributesBindings queryAttributesBindings

Query attributes bindings

resultSetTypeback to summary
protected Resultset.Type resultSetType

The type of this result set (scroll sensitive or in-sensitive)

sessionback to summary
public NativeSession session
statementCounterback to summary
pack-priv static int statementCounter

Used to generate IDs when profiling.

statementExecutingback to summary
protected final AtomicBoolean statementExecuting

Currently executing a statement?

statementIdback to summary
protected int statementId

Used to identify this statement when profiling.

timeoutInMillisback to summary
protected long timeoutInMillis

The timeout for a query

Constructor Detail

AbstractQueryback to summary
public AbstractQuery(NativeSession sess)

Method Detail

addBatchback to summary
public void addBatch(Object batch)

Implements com.mysql.cj.Query.addBatch.

Annotations
@Override
checkCancelTimeoutback to summary
public void checkCancelTimeout()

Implements com.mysql.cj.Query.checkCancelTimeout.

Annotations
@Override
clearBatchedArgsback to summary
public void clearBatchedArgs()

Implements com.mysql.cj.Query.clearBatchedArgs.

Annotations
@Override
closeQueryback to summary
public void closeQuery()

Implements com.mysql.cj.Query.closeQuery.

Annotations
@Override
getBatchedArgsback to summary
public List<Object> getBatchedArgs()

Implements com.mysql.cj.Query.getBatchedArgs.

Doc from com.mysql.cj.Query.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:List<Object>

an unmodifiable List of batched args

Annotations
@Override
getCancelTimeoutLockback to summary
public Lock getCancelTimeoutLock()

Implements com.mysql.cj.Query.getCancelTimeoutLock.

Annotations
@Override
getCurrentDatabaseback to summary
public String getCurrentDatabase()

Implements com.mysql.cj.Query.getCurrentDatabase.

Annotations
@Override
getExecuteTimeback to summary
public long getExecuteTime()

Implements com.mysql.cj.Query.getExecuteTime.

Doc from com.mysql.cj.Query.getExecuteTime.

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

Returns:long

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

Annotations
@Override
getIdback to summary
public int getId()

Implements com.mysql.cj.Query.getId.

Doc from com.mysql.cj.Query.getId.

Returns the query id used when profiling

Returns:int

id

Annotations
@Override
getQueryAttributesBindingsback to summary
public QueryAttributesBindings getQueryAttributesBindings()

Implements com.mysql.cj.Query.getQueryAttributesBindings.

Annotations
@Override
getResultFetchSizeback to summary
public int getResultFetchSize()

Implements com.mysql.cj.Query.getResultFetchSize.

Annotations
@Override
getResultSetFactoryback to summary
public <T extends Resultset, M extends Message> ProtocolEntityFactory<T, M> getResultSetFactory()

Implements com.mysql.cj.Query.getResultSetFactory.

Annotations
@Override
getResultTypeback to summary
public Resultset.Type getResultType()

Implements com.mysql.cj.Query.getResultType.

Annotations
@Override
getSessionback to summary
public NativeSession getSession()

Implements com.mysql.cj.Query.getSession.

Annotations
@Override
getStatementExecutingback to summary
public AtomicBoolean getStatementExecuting()

Implements com.mysql.cj.Query.getStatementExecuting.

Annotations
@Override
getTimeoutInMillisback to summary
public long getTimeoutInMillis()

Implements com.mysql.cj.Query.getTimeoutInMillis.

Annotations
@Override
isClearWarningsCalledback to summary
public boolean isClearWarningsCalled()

Implements com.mysql.cj.Query.isClearWarningsCalled.

Annotations
@Override
resetCancelledStateback to summary
public void resetCancelledState()

Implements com.mysql.cj.Query.resetCancelledState.

Annotations
@Override
setCancelStatusback to summary
public void setCancelStatus(Query.CancelStatus cs)

Implements com.mysql.cj.Query.setCancelStatus.

Annotations
@Override
setClearWarningsCalledback to summary
public void setClearWarningsCalled(boolean clearWarningsCalled)

Implements com.mysql.cj.Query.setClearWarningsCalled.

Annotations
@Override
setCurrentDatabaseback to summary
public void setCurrentDatabase(String currentDb)

Implements com.mysql.cj.Query.setCurrentDatabase.

Annotations
@Override
setExecuteTimeback to summary
public void setExecuteTime(long executeTime)

Implements com.mysql.cj.Query.setExecuteTime.

Annotations
@Override
setResultFetchSizeback to summary
public void setResultFetchSize(int fetchSize)

Implements com.mysql.cj.Query.setResultFetchSize.

Annotations
@Override
setResultTypeback to summary
public void setResultType(Resultset.Type resultSetType)

Implements com.mysql.cj.Query.setResultType.

Annotations
@Override
setTimeoutInMillisback to summary
public void setTimeoutInMillis(long timeoutInMillis)

Implements com.mysql.cj.Query.setTimeoutInMillis.

Annotations
@Override
startQueryTimerback to summary
public CancelQueryTask startQueryTimer(Query stmtToCancel, long timeout)

Implements com.mysql.cj.Query.startQueryTimer.

Annotations
@Override
statementBeginsback to summary
public void statementBegins()

Implements com.mysql.cj.Query.statementBegins.

Annotations
@Override
stopQueryTimerback to summary
public void stopQueryTimer(CancelQueryTask timeoutTask, boolean rethrowCancelReason, boolean checkCancelTimeout)

Implements com.mysql.cj.Query.stopQueryTimer.

Annotations
@Override