public class MysqlxSession extends CoreSession
Session.SessionEventListener
autoReconnect, autoReconnectForPools, cacheServerConfiguration, characterEncoding, connectionCreationTimeMillis, disconnectOnExpiredPasswords, exceptionInterceptor, gatherPerfMetrics, hostInfo, log, maintainTimeStats, messageBuilder, NULL_LOGGER, propertySet, protocol, sessionMaxRows
Constructor and Description |
---|
MysqlxSession(HostInfo hostInfo,
PropertySet propSet) |
MysqlxSession(XProtocol prot) |
Modifier and Type | Method and Description |
---|---|
boolean |
failedPreparingStatement(int preparedStatementId,
XProtocolError e)
Propagate to the underlying protocol instance that preparing a statement on the connected server failed.
|
void |
freePreparedStatementId(int preparedStatementId)
Free a prepared statement id so that it can be reused.
|
int |
getNewPreparedStatementId(PreparableStatement<?> preparableStatement)
Return an id to be used as a client-managed prepared statement id.
|
int |
getPort() |
java.lang.String |
getProcessHost() |
XProtocol |
getProtocol() |
boolean |
isClosed() |
<M extends Message,R,RES> |
query(M message,
java.util.function.Predicate<Row> rowFilter,
java.util.function.Function<Row,R> rowMapper,
java.util.stream.Collector<R,?,RES> collector)
Synchronously query database with applying rows filtering and mapping.
|
<M extends Message,R extends QueryResult> |
query(M message,
ResultBuilder<R> resultBuilder)
Synchronously query database.
|
<M extends Message,R extends QueryResult> |
queryAsync(M message,
ResultBuilder<R> resultBuilder)
Asynchronously query database.
|
void |
quit()
Log-off of the MySQL server and close the socket.
|
boolean |
readyForPreparingStatements()
Check if enough statements were executed in the underlying MySQL server so that another prepare statement attempt should be done.
|
boolean |
supportsPreparedStatements()
Check if current session is using a MySQL server that supports prepared statements.
|
addListener, changeUser, forceClose, getDataStoreMetadata, getExceptionInterceptor, getHostInfo, getIdentifierQuoteString, getLog, getMessageBuilder, getProfilerEventHandler, getPropertySet, getQueryTimingUnits, getRemoteSocketAddress, getServerSession, getThreadId, isSetNeededForAutoCommitMode, isSSLEstablished, removeListener, setExceptionInterceptor, versionMeetsMinimum
public MysqlxSession(HostInfo hostInfo, PropertySet propSet)
public MysqlxSession(XProtocol prot)
public java.lang.String getProcessHost()
public int getPort()
public XProtocol getProtocol()
public void quit()
Session
quit
in interface Session
quit
in class CoreSession
public boolean isClosed()
public boolean supportsPreparedStatements()
true
if the MySQL server in use supports prepared statementspublic boolean readyForPreparingStatements()
true
if enough executions have been done since last time a prepared statement failed to be preparedpublic int getNewPreparedStatementId(PreparableStatement<?> preparableStatement)
preparableStatement
- PreparableStatement
public void freePreparedStatementId(int preparedStatementId)
preparedStatementId
- the prepared statement id to releasepublic boolean failedPreparingStatement(int preparedStatementId, XProtocolError e)
preparedStatementId
- the id of the prepared statement that failed to be preparede
- XProtocolError
true
if the exception was properly handledpublic <M extends Message,R,RES> RES query(M message, java.util.function.Predicate<Row> rowFilter, java.util.function.Function<Row,R> rowMapper, java.util.stream.Collector<R,?,RES> collector)
Session
M
- Message typeR
- Row typeRES
- Result typemessage
- query messagerowFilter
- row filter functionrowMapper
- row map functioncollector
- result collectorpublic <M extends Message,R extends QueryResult> R query(M message, ResultBuilder<R> resultBuilder)
Session
M
- Message typeR
- Result typemessage
- query messageresultBuilder
- ResultBuilder instanceQueryResult
objectpublic <M extends Message,R extends QueryResult> java.util.concurrent.CompletableFuture<R> queryAsync(M message, ResultBuilder<R> resultBuilder)
Session
M
- Message typeR
- Result typemessage
- query messageresultBuilder
- ResultBuilder instanceQueryResult
object