程序包 com.mysql.cj

类 NativeSession

    • 方法详细资料

      • quit

        public void quit()
        从接口复制的说明: Session
        Log-off of the MySQL server and close the socket.
        指定者:
        quit 在接口中 Session
        覆盖:
        quit 在类中 CoreSession
      • forceClose

        public void forceClose()
        从接口复制的说明: Session
        Clobbers the physical network connection and marks this session as closed.
        指定者:
        forceClose 在接口中 Session
        覆盖:
        forceClose 在类中 CoreSession
      • enableMultiQueries

        public void enableMultiQueries()
      • disableMultiQueries

        public void disableMultiQueries()
      • getSessionMaxRows

        public int getSessionMaxRows()
      • setSessionMaxRows

        public void setSessionMaxRows​(int sessionMaxRows)
      • setQueryInterceptors

        public void setQueryInterceptors​(List<QueryInterceptor> queryInterceptors)
      • isServerLocal

        public boolean isServerLocal​(Session sess)
      • shutdownServer

        public void shutdownServer()
        Used by MiniAdmin to shutdown a MySQL server
      • setSocketTimeout

        public void setSocketTimeout​(int milliseconds)
      • getSocketTimeout

        public int getSocketTimeout()
      • getSharedSendPacket

        public NativePacketPayload getSharedSendPacket()
        Returns the packet used for sending data (used by PreparedStatement) with position set to 0. Guarded by external synchronization on a mutex.
        返回:
        A packet to send data with
      • dumpPacketRingBuffer

        public void dumpPacketRingBuffer()
      • invokeQueryInterceptorsPre

        public <T extends Resultset> T invokeQueryInterceptorsPre​(java.util.function.Supplier<String> sql,
                                                                  Query interceptedQuery,
                                                                  boolean forceExecute)
      • invokeQueryInterceptorsPost

        public <T extends Resultset> T invokeQueryInterceptorsPost​(java.util.function.Supplier<String> sql,
                                                                   Query interceptedQuery,
                                                                   T originalResultSet,
                                                                   boolean forceExecute)
      • shouldIntercept

        public boolean shouldIntercept()
      • getCurrentTimeNanosOrMillis

        public long getCurrentTimeNanosOrMillis()
      • getSlowQueryThreshold

        public long getSlowQueryThreshold()
      • hadWarnings

        public boolean hadWarnings()
      • clearInputStream

        public void clearInputStream()
      • getCommandCount

        public int getCommandCount()
      • getLocalInfileInputStream

        public InputStream getLocalInfileInputStream()
      • setLocalInfileInputStream

        public void setLocalInfileInputStream​(InputStream stream)
      • loadServerVariables

        public void loadServerVariables​(Object syncMutex,
                                        String version)
        Loads the result of 'SHOW VARIABLES' into the serverVariables field so that the driver can configure itself.
        参数:
        syncMutex - synchronization mutex
        version - driver version string
      • setSessionVariables

        public void setSessionVariables()
      • queryServerVariable

        public String queryServerVariable​(String varName)
        Get the variable value from server.
        参数:
        varName - server variable name
        返回:
        server variable value
      • execSQL

        public <T extends Resultset> T execSQL​(Query callingQuery,
                                               String query,
                                               int maxRows,
                                               NativePacketPayload packet,
                                               boolean streamResults,
                                               ProtocolEntityFactory<T,​NativePacketPayload> resultSetFactory,
                                               ColumnDefinition cachedMetadata,
                                               boolean isBatch)
        Send a query to the server. Returns one of the ResultSet objects. To ensure that Statement's queries are serialized, calls to this method should be enclosed in a connection mutex synchronized block.
        类型参数:
        T - extends Resultset
        参数:
        callingQuery - Query object
        query - the SQL statement to be executed
        maxRows - rows limit
        packet - NativePacketPayload
        streamResults - whether a stream result should be created
        resultSetFactory - ProtocolEntityFactory
        cachedMetadata - use this metadata instead of the one provided on wire
        isBatch - is it a batch query
        返回:
        a ResultSet holding the results
      • getIdleFor

        public long getIdleFor()
      • isNeedsPing

        public boolean isNeedsPing()
      • setNeedsPing

        public void setNeedsPing​(boolean needsPing)
      • ping

        public void ping​(boolean checkForClosedConnection,
                         int timeoutMillis)
      • getConnectionCreationTimeMillis

        public long getConnectionCreationTimeMillis()
      • setConnectionCreationTimeMillis

        public void setConnectionCreationTimeMillis​(long connectionCreationTimeMillis)
      • isClosed

        public boolean isClosed()
        指定者:
        isClosed 在接口中 Session
      • checkClosed

        public void checkClosed()
      • getForceClosedReason

        public Throwable getForceClosedReason()
      • setForceClosedReason

        public void setForceClosedReason​(Throwable forceClosedReason)
      • invokeNormalCloseListeners

        protected void invokeNormalCloseListeners()
      • invokeReconnectListeners

        protected void invokeReconnectListeners()
      • invokeCleanupListeners

        public void invokeCleanupListeners​(Throwable whyCleanedUp)
      • getCancelTimer

        public Timer getCancelTimer()