程序包 com.mysql.cj

类 MysqlxSession

    • 构造器详细资料

      • MysqlxSession

        public MysqlxSession​(XProtocol prot)
    • 方法详细资料

      • getProcessHost

        public String getProcessHost()
      • getPort

        public int getPort()
      • getProtocol

        public XProtocol getProtocol()
      • quit

        public void quit()
        从接口复制的说明: Session
        Log-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.
        返回:
        true if 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.
        返回:
        true if 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 prepared
        e - XProtocolError
        返回:
        true if 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)
        从接口复制的说明: Session
        Synchronously query database with applying rows filtering and mapping.
        类型参数:
        M - Message type
        R - Row type
        RES - Result type
        参数:
        message - query message
        rowFilter - row filter function
        rowMapper - row map function
        collector - result collector
        返回:
        List of rows
      • query

        public <M extends Message,​R extends QueryResult> R query​(M message,
                                                                       ResultBuilder<R> resultBuilder)
        从接口复制的说明: Session
        Synchronously query database.
        类型参数:
        M - Message type
        R - Result type
        参数:
        message - query message
        resultBuilder - ResultBuilder instance
        返回:
        QueryResult object
      • queryAsync

        public <M extends Message,​R extends QueryResultCompletableFuture<R> queryAsync​(M message,
                                                                                               ResultBuilder<R> resultBuilder)
        从接口复制的说明: Session
        Asynchronously query database.
        类型参数:
        M - Message type
        R - Result type
        参数:
        message - query message
        resultBuilder - ResultBuilder instance
        返回:
        CompletableFuture providing a QueryResult object