Top Fields Constructors Methods
com.mysql.cj

public Class MysqlxSession

extends CoreSession
Class Inheritance
Imports
java.io.IOException, java.util.Iterator, .Spliterators, java.util.concurrent.CompletableFuture, java.util.function.Function, .Predicate, java.util.stream.Collector, .Stream, .StreamSupport, com.mysql.cj.conf.HostInfo, .PropertySet, com.mysql.cj.exceptions.CJCommunicationsException, com.mysql.cj.protocol.ColumnDefinition, .Message, .ResultBuilder, com.mysql.cj.protocol.x.StatementExecuteOkBuilder, .XProtocol, .XProtocolError, .XProtocolRowInputStream, com.mysql.cj.result.Row, com.mysql.cj.xdevapi.PreparableStatement

Field Summary

Inherited from com.mysql.cj.CoreSession:
autoReconnectautoReconnectForPoolscacheServerConfigurationcharacterEncodingconnectionCreationTimeMillisdisconnectOnExpiredPasswordsexceptionInterceptorgatherPerfMetricshostInfologmaintainTimeStatsmessageBuilderNULL_LOGGERpropertySetprotocolsessionMaxRows

Constructor Summary

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

public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the exception was properly handled
failedPreparingStatement
(int
the id of the prepared statement that failed to be prepared
preparedStatementId
,
XProtocolError e)

Propagate to the underlying protocol instance that preparing a statement on the connected server failed.

public void
freePreparedStatementId(int
the prepared statement id to release
preparedStatementId
)

Free a prepared statement id so that it can be reused.

public int

Returns:

a new identifier to be used as prepared statement id
getNewPreparedStatementId
(PreparableStatement<?> preparableStatement)

Return an id to be used as a client-managed prepared statement id.

public int
public String
public XProtocol
public boolean
public <M extends Message, R, RES> RES
query(M
query message
message
,
Predicate<Row>
row filter function
rowFilter
,
Function<Row, R>
row map function
rowMapper
,
Collector<R, ?, RES>
result collector
collector
)

Overrides default com.mysql.cj.Session.query.

Synchronously query database with applying rows filtering and mapping.

public <M extends Message, R extends QueryResult> R
query(M
query message
message
,
ResultBuilder<R>
ResultBuilder instance
resultBuilder
)

Overrides default com.mysql.cj.Session.query.

Synchronously query database.

public <M extends Message, R extends QueryResult> CompletableFuture<R>
queryAsync(M
query message
message
,
ResultBuilder<R>
ResultBuilder instance
resultBuilder
)

Overrides default com.mysql.cj.Session.queryAsync.

Asynchronously query database.

public void
quit()

Overrides com.mysql.cj.CoreSession.quit.

Implements com.mysql.cj.Session.quit.

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

public boolean

Returns:

true if enough executions have been done since last time a prepared statement failed to be prepared
readyForPreparingStatements
()

Check if enough statements were executed in the underlying MySQL server so that another prepare statement attempt should be done.

public boolean

Returns:

true if the MySQL server in use supports prepared statements
supportsPreparedStatements
()

Check if current session is using a MySQL server that supports prepared statements.

Inherited from com.mysql.cj.CoreSession:
addListenerchangeUserforceClosegetDataStoreMetadatagetExceptionInterceptorgetHostInfogetIdentifierQuoteStringgetLoggetMessageBuildergetProfilerEventHandlergetPropertySetgetQueryCommentgetQueryTimingUnitsgetRemoteSocketAddressgetServerSessiongetSessionLockgetTelemetryHandlergetThreadIdisSetNeededForAutoCommitModeisSSLEstablishedremoveListenersetExceptionInterceptorsetQueryCommentsetTelemetryHandlerversionMeetsMinimum

Constructor Detail

MysqlxSessionback to summary
public MysqlxSession(HostInfo hostInfo, PropertySet propSet)
MysqlxSessionback to summary
public MysqlxSession(XProtocol prot)

Method Detail

failedPreparingStatementback to summary
public boolean failedPreparingStatement(int preparedStatementId, XProtocolError e)

Propagate to the underlying protocol instance that preparing a statement on the connected server failed.

Parameters
preparedStatementId:int

the id of the prepared statement that failed to be prepared

e:XProtocolError

XProtocolError

Returns:boolean

true if the exception was properly handled

freePreparedStatementIdback to summary
public void freePreparedStatementId(int preparedStatementId)

Free a prepared statement id so that it can be reused.

Parameters
preparedStatementId:int

the prepared statement id to release

getNewPreparedStatementIdback to summary
public int getNewPreparedStatementId(PreparableStatement<?> preparableStatement)

Return an id to be used as a client-managed prepared statement id.

Parameters
preparableStatement:PreparableStatement<?>

PreparableStatement

Returns:int

a new identifier to be used as prepared statement id

getPortback to summary
public int getPort()
getProcessHostback to summary
public String getProcessHost()

Implements com.mysql.cj.Session.getProcessHost.

Annotations
@Override
getProtocolback to summary
public XProtocol getProtocol()
isClosedback to summary
public boolean isClosed()

Implements com.mysql.cj.Session.isClosed.

Annotations
@Override
queryback to summary
public <M extends Message, R, RES> RES query(M message, Predicate<Row> rowFilter, Function<Row, R> rowMapper, Collector<R, ?, RES> collector)

Overrides default com.mysql.cj.Session.query.

Doc from com.mysql.cj.Session.query.

Synchronously query database with applying rows filtering and mapping.

Parameters
<M>
Message type
<R>
Row type
<RES>
Result type
message:M

query message

rowFilter:Predicate<Row>

row filter function

rowMapper:Function<Row, R>

row map function

collector:Collector<R, ?, RES>

result collector

Returns:RES

List of rows

Annotations
@Override
queryback to summary
public <M extends Message, R extends QueryResult> R query(M message, ResultBuilder<R> resultBuilder)

Overrides default com.mysql.cj.Session.query.

Doc from com.mysql.cj.Session.query.

Synchronously query database.

Parameters
<M>
Message type
<R>
Result type
message:M

query message

resultBuilder:ResultBuilder<R>

ResultBuilder instance

Returns:R

QueryResult object

Annotations
@Override
queryAsyncback to summary
public <M extends Message, R extends QueryResult> CompletableFuture<R> queryAsync(M message, ResultBuilder<R> resultBuilder)

Overrides default com.mysql.cj.Session.queryAsync.

Doc from com.mysql.cj.Session.queryAsync.

Asynchronously query database.

Parameters
<M>
Message type
<R>
Result type
message:M

query message

resultBuilder:ResultBuilder<R>

ResultBuilder instance

Returns:CompletableFuture<R>

CompletableFuture providing a QueryResult object

Annotations
@Override
quitback to summary
public void quit()

Overrides com.mysql.cj.CoreSession.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
readyForPreparingStatementsback to summary
public boolean readyForPreparingStatements()

Check if enough statements were executed in the underlying MySQL server so that another prepare statement attempt should be done.

Returns:boolean

true if enough executions have been done since last time a prepared statement failed to be prepared

supportsPreparedStatementsback to summary
public boolean supportsPreparedStatements()

Check if current session is using a MySQL server that supports prepared statements.

Returns:boolean

true if the MySQL server in use supports prepared statements