程序包 com.mysql.cj
类 MysqlxSession
- java.lang.Object
-
- com.mysql.cj.CoreSession
-
- com.mysql.cj.MysqlxSession
-
- 所有已实现的接口:
Session
public class MysqlxSession extends CoreSession
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.mysql.cj.Session
Session.SessionEventListener
-
-
字段概要
-
从类继承的字段 com.mysql.cj.CoreSession
autoReconnect, autoReconnectForPools, cacheServerConfiguration, characterEncoding, connectionCreationTimeMillis, disconnectOnExpiredPasswords, exceptionInterceptor, gatherPerfMetrics, hostInfo, log, maintainTimeStats, messageBuilder, NULL_LOGGER, propertySet, protocol, sessionMaxRows
-
-
构造器概要
构造器 构造器 说明 MysqlxSession(HostInfo hostInfo, PropertySet propSet)MysqlxSession(XProtocol prot)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanfailedPreparingStatement(int preparedStatementId, XProtocolError e)Propagate to the underlying protocol instance that preparing a statement on the connected server failed.voidfreePreparedStatementId(int preparedStatementId)Free a prepared statement id so that it can be reused.intgetNewPreparedStatementId(PreparableStatement<?> preparableStatement)Return an id to be used as a client-managed prepared statement id.intgetPort()StringgetProcessHost()XProtocolgetProtocol()booleanisClosed()<M extends Message,R extends QueryResult>
Rquery(M message, ResultBuilder<R> resultBuilder)Synchronously query database.<M extends Message,R,RES>
RESquery(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>
CompletableFuture<R>queryAsync(M message, ResultBuilder<R> resultBuilder)Asynchronously query database.voidquit()Log-off of the MySQL server and close the socket.booleanreadyForPreparingStatements()Check if enough statements were executed in the underlying MySQL server so that another prepare statement attempt should be done.booleansupportsPreparedStatements()Check if current session is using a MySQL server that supports prepared statements.-
从类继承的方法 com.mysql.cj.CoreSession
addListener, changeUser, forceClose, getDataStoreMetadata, getExceptionInterceptor, getHostInfo, getIdentifierQuoteString, getLog, getMessageBuilder, getProfilerEventHandler, getPropertySet, getQueryTimingUnits, getRemoteSocketAddress, getServerSession, getThreadId, isSetNeededForAutoCommitMode, isSSLEstablished, removeListener, setExceptionInterceptor, versionMeetsMinimum
-
-
-
-
构造器详细资料
-
MysqlxSession
public MysqlxSession(HostInfo hostInfo, PropertySet propSet)
-
MysqlxSession
public MysqlxSession(XProtocol prot)
-
-
方法详细资料
-
getProcessHost
public String getProcessHost()
-
getPort
public int getPort()
-
getProtocol
public XProtocol getProtocol()
-
quit
public void quit()
从接口复制的说明:SessionLog-off of the MySQL server and close the socket.- 指定者:
quit在接口中Session- 覆盖:
quit在类中CoreSession
-
isClosed
public boolean isClosed()
-
supportsPreparedStatements
public boolean supportsPreparedStatements()
Check if current session is using a MySQL server that supports prepared statements.- 返回:
trueif the MySQL server in use supports prepared statements
-
readyForPreparingStatements
public boolean readyForPreparingStatements()
Check if enough statements were executed in the underlying MySQL server so that another prepare statement attempt should be done.- 返回:
trueif enough executions have been done since last time a prepared statement failed to be prepared
-
getNewPreparedStatementId
public int getNewPreparedStatementId(PreparableStatement<?> preparableStatement)
Return an id to be used as a client-managed prepared statement id.- 参数:
preparableStatement-PreparableStatement- 返回:
- a new identifier to be used as prepared statement id
-
freePreparedStatementId
public void freePreparedStatementId(int preparedStatementId)
Free a prepared statement id so that it can be reused.- 参数:
preparedStatementId- the prepared statement id to release
-
failedPreparingStatement
public boolean failedPreparingStatement(int preparedStatementId, XProtocolError e)Propagate to the underlying protocol instance that preparing a statement on the connected server failed.- 参数:
preparedStatementId- the id of the prepared statement that failed to be preparede-XProtocolError- 返回:
trueif the exception was properly handled
-
query
public <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)
从接口复制的说明:SessionSynchronously query database with applying rows filtering and mapping.- 类型参数:
M- Message typeR- Row typeRES- Result type- 参数:
message- query messagerowFilter- row filter functionrowMapper- row map functioncollector- result collector- 返回:
- List of rows
-
query
public <M extends Message,R extends QueryResult> R query(M message, ResultBuilder<R> resultBuilder)
从接口复制的说明:SessionSynchronously query database.- 类型参数:
M- Message typeR- Result type- 参数:
message- query messageresultBuilder- ResultBuilder instance- 返回:
QueryResultobject
-
queryAsync
public <M extends Message,R extends QueryResult> CompletableFuture<R> queryAsync(M message, ResultBuilder<R> resultBuilder)
从接口复制的说明:SessionAsynchronously query database.- 类型参数:
M- Message typeR- Result type- 参数:
message- query messageresultBuilder- ResultBuilder instance- 返回:
- CompletableFuture providing a
QueryResultobject
-
-