Top Fields Constructors Methods
com.mysql.cj

public abstract Class CoreSession

extends Object
implements Session
Class Inheritance
All Implemented Interfaces
com.mysql.cj.Session
Known Direct Subclasses
com.mysql.cj.MysqlxSession, com.mysql.cj.NativeSession
Imports
java.net.SocketAddress, java.util.concurrent.locks.Lock, .ReentrantLock, com.mysql.cj.conf.HostInfo, .PropertyKey, .PropertySet, .RuntimeProperty, com.mysql.cj.exceptions.CJOperationNotSupportedException, .ExceptionFactory, .ExceptionInterceptor, com.mysql.cj.log.Log, .LogFactory, .NullLogger, .ProfilerEventHandler, com.mysql.cj.protocol.Message, .Protocol, .ServerSession, com.mysql.cj.telemetry.TelemetryHandler, com.mysql.cj.util.Util

Field Summary

Modifier and TypeField and Description
protected RuntimeProperty<Boolean>
protected RuntimeProperty<Boolean>
protected RuntimeProperty<Boolean>
protected RuntimeProperty<String>
protected long
connectionCreationTimeMillis

The point in time when this connection was created

protected RuntimeProperty<Boolean>
private ProfilerEventHandler
eventSink

The event sink to use for profiling

protected ExceptionInterceptor
protected RuntimeProperty<Boolean>
protected HostInfo
private final Lock
protected transient Log
log

The logger we're going to use

protected RuntimeProperty<Boolean>
protected MessageBuilder<? extends Message>
protected static final Log
NULL_LOGGER

Null logger shared by all connections at startup

protected PropertySet
protected transient Protocol<? extends Message>
protected int
sessionMaxRows

The max-rows setting for current session

private TelemetryHandler
telemetryHandler

The telemetry handler to process telemetry operations

Constructor Summary

AccessConstructor and Description
public
CoreSession(HostInfo hostInfo, PropertySet propSet)

Method Summary

Modifier and TypeMethod and Description
public void
addListener(Session.SessionEventListener l)

Implements com.mysql.cj.Session.addListener.

Add listener for this session status changes.

public void
changeUser(String
DB user name
user
,
String
DB user password
password
,
String
database name
database
)

Implements com.mysql.cj.Session.changeUser.

Re-authenticates as the given user and password

public void
forceClose()

Implements com.mysql.cj.Session.forceClose.

Clobbers the physical network connection and marks this session as closed.

public DataStoreMetadata
public ExceptionInterceptor
public HostInfo
public String
public Log
getLog()

Implements com.mysql.cj.Session.getLog.

Returns the log mechanism that should be used to log information from/for this Session.

public <M extends Message> MessageBuilder<M>
public ProfilerEventHandler
getProfilerEventHandler()

Implements com.mysql.cj.Session.getProfilerEventHandler.

Returns the current ProfilerEventHandler or initializes a new one if none exists.

public PropertySet
public String
getQueryComment()

Implements com.mysql.cj.Session.getQueryComment.

Returns the comment that will be prepended to all statements sent to the server.

public String
public SocketAddress
public ServerSession
public Lock
public TelemetryHandler
public long
public boolean
public boolean
public void
quit()

Implements com.mysql.cj.Session.quit.

Log-off of the MySQL server and close the socket.

public void
public void
public void
setQueryComment(String
query comment string
comment
)

Implements com.mysql.cj.Session.setQueryComment.

Sets the comment that will be prepended to all statements sent to the server.

public void
public boolean
versionMeetsMinimum(int
major version number
major
,
int
minor version number
minor
,
int
sub-minor version number
subminor
)

Implements com.mysql.cj.Session.versionMeetsMinimum.

Does the version of the MySQL server we are connected to meet the given minimums?

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoReconnectback to summary
protected RuntimeProperty<Boolean> autoReconnect
autoReconnectForPoolsback to summary
protected RuntimeProperty<Boolean> autoReconnectForPools
cacheServerConfigurationback to summary
protected RuntimeProperty<Boolean> cacheServerConfiguration
characterEncodingback to summary
protected RuntimeProperty<String> characterEncoding
connectionCreationTimeMillisback to summary
protected long connectionCreationTimeMillis

The point in time when this connection was created

disconnectOnExpiredPasswordsback to summary
protected RuntimeProperty<Boolean> disconnectOnExpiredPasswords
eventSinkback to summary
private ProfilerEventHandler eventSink

The event sink to use for profiling

exceptionInterceptorback to summary
protected ExceptionInterceptor exceptionInterceptor
gatherPerfMetricsback to summary
protected RuntimeProperty<Boolean> gatherPerfMetrics
hostInfoback to summary
protected HostInfo hostInfo
lockback to summary
private final Lock lock
logback to summary
protected transient Log log

The logger we're going to use

maintainTimeStatsback to summary
protected RuntimeProperty<Boolean> maintainTimeStats
messageBuilderback to summary
protected MessageBuilder<? extends Message> messageBuilder
NULL_LOGGERback to summary
protected static final Log NULL_LOGGER

Null logger shared by all connections at startup

propertySetback to summary
protected PropertySet propertySet
protocolback to summary
protected transient Protocol<? extends Message> protocol
sessionMaxRowsback to summary
protected int sessionMaxRows

The max-rows setting for current session

telemetryHandlerback to summary
private TelemetryHandler telemetryHandler

The telemetry handler to process telemetry operations

Constructor Detail

CoreSessionback to summary
public CoreSession(HostInfo hostInfo, PropertySet propSet)

Method Detail

addListenerback to summary
public void addListener(Session.SessionEventListener l)

Implements com.mysql.cj.Session.addListener.

Doc from com.mysql.cj.Session.addListener.

Add listener for this session status changes.

Parameters
l:Session.SessionEventListener

SessionEventListener instance.

Annotations
@Override
changeUserback to summary
public void changeUser(String user, String password, String database)

Implements com.mysql.cj.Session.changeUser.

Doc from com.mysql.cj.Session.changeUser.

Re-authenticates as the given user and password

Parameters
user:String

DB user name

password:String

DB user password

database:String

database name

Annotations
@Override
forceCloseback to summary
public void forceClose()

Implements com.mysql.cj.Session.forceClose.

Doc from com.mysql.cj.Session.forceClose.

Clobbers the physical network connection and marks this session as closed.

Annotations
@Override
getDataStoreMetadataback to summary
public DataStoreMetadata getDataStoreMetadata()

Implements com.mysql.cj.Session.getDataStoreMetadata.

Annotations
@Override
getExceptionInterceptorback to summary
public ExceptionInterceptor getExceptionInterceptor()

Implements com.mysql.cj.Session.getExceptionInterceptor.

Annotations
@Override
getHostInfoback to summary
public HostInfo getHostInfo()

Implements com.mysql.cj.Session.getHostInfo.

Annotations
@Override
getIdentifierQuoteStringback to summary
public String getIdentifierQuoteString()

Implements com.mysql.cj.Session.getIdentifierQuoteString.

Annotations
@Override
getLogback to summary
public Log getLog()

Implements com.mysql.cj.Session.getLog.

Doc from com.mysql.cj.Session.getLog.

Returns the log mechanism that should be used to log information from/for this Session.

Returns:Log

the Log instance to use for logging messages.

Annotations
@Override
getMessageBuilderback to summary
public <M extends Message> MessageBuilder<M> getMessageBuilder()

Implements com.mysql.cj.Session.getMessageBuilder.

Annotations
@SuppressWarnings:unchecked
@Override
getProfilerEventHandlerback to summary
public ProfilerEventHandler getProfilerEventHandler()

Implements com.mysql.cj.Session.getProfilerEventHandler.

Doc from com.mysql.cj.Session.getProfilerEventHandler.

Returns the current ProfilerEventHandler or initializes a new one if none exists.

Returns:ProfilerEventHandler

the ProfilerEventHandler object.

Annotations
@Override
getPropertySetback to summary
public PropertySet getPropertySet()

Implements com.mysql.cj.Session.getPropertySet.

Annotations
@Override
getQueryCommentback to summary
public String getQueryComment()

Implements com.mysql.cj.Session.getQueryComment.

Doc from com.mysql.cj.Session.getQueryComment.

Returns the comment that will be prepended to all statements sent to the server.

Returns:String

query comment string

Annotations
@Override
getQueryTimingUnitsback to summary
public String getQueryTimingUnits()

Implements com.mysql.cj.Session.getQueryTimingUnits.

Annotations
@Override
getRemoteSocketAddressback to summary
public SocketAddress getRemoteSocketAddress()

Implements com.mysql.cj.Session.getRemoteSocketAddress.

Annotations
@Override
getServerSessionback to summary
public ServerSession getServerSession()

Implements com.mysql.cj.Session.getServerSession.

Annotations
@Override
getSessionLockback to summary
public Lock getSessionLock()

Implements com.mysql.cj.Session.getSessionLock.

Annotations
@Override
getTelemetryHandlerback to summary
public TelemetryHandler getTelemetryHandler()

Implements com.mysql.cj.Session.getTelemetryHandler.

Annotations
@Override
getThreadIdback to summary
public long getThreadId()

Implements com.mysql.cj.Session.getThreadId.

Annotations
@Override
isSetNeededForAutoCommitModeback to summary
public boolean isSetNeededForAutoCommitMode(boolean autoCommitFlag)

Implements com.mysql.cj.Session.isSetNeededForAutoCommitMode.

Annotations
@Override
isSSLEstablishedback to summary
public boolean isSSLEstablished()

Implements com.mysql.cj.Session.isSSLEstablished.

Annotations
@Override
quitback to summary
public void quit()

Implements com.mysql.cj.Session.quit.

Doc from com.mysql.cj.Session.quit.

Log-off of the MySQL server and close the socket.

Annotations
@Override
removeListenerback to summary
public void removeListener(Session.SessionEventListener l)

Implements com.mysql.cj.Session.removeListener.

Doc from com.mysql.cj.Session.removeListener.

Remove session listener.

Parameters
l:Session.SessionEventListener

SessionEventListener instance.

Annotations
@Override
setExceptionInterceptorback to summary
public void setExceptionInterceptor(ExceptionInterceptor exceptionInterceptor)

Implements com.mysql.cj.Session.setExceptionInterceptor.

Annotations
@Override
setQueryCommentback to summary
public void setQueryComment(String comment)

Implements com.mysql.cj.Session.setQueryComment.

Doc from com.mysql.cj.Session.setQueryComment.

Sets the comment that will be prepended to all statements sent to the server. Do not use slash-star or star-slash tokens in the comment as these will be added by the driver itself.

Parameters
comment:String

query comment string

Annotations
@Override
setTelemetryHandlerback to summary
public void setTelemetryHandler(TelemetryHandler telemetryHandler)

Implements com.mysql.cj.Session.setTelemetryHandler.

Annotations
@Override
versionMeetsMinimumback to summary
public boolean versionMeetsMinimum(int major, int minor, int subminor)

Implements com.mysql.cj.Session.versionMeetsMinimum.

Doc from com.mysql.cj.Session.versionMeetsMinimum.

Does the version of the MySQL server we are connected to meet the given minimums?

Parameters
major:int

major version number

minor:int

minor version number

subminor:int

sub-minor version number

Returns:boolean

true if current server version equal or higher than provided one

Annotations
@Override