Session exposes logical level which user API uses internally to call Protocol methods.
It's a higher-level abstraction than MySQL server session (ServerSession). Protocol and ServerSession methods
should never be used directly from user API.
| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Method and Description |
|---|---|
| public void | addListener(Session.
SessionEventListener instance.Add listener for this session status changes. |
| public void | changeUser(String
DB user name userName, String DB user password password, String database name database)Re-authenticates as the given user and password |
| public void | |
| public DataStoreMetadata | |
| public ExceptionInterceptor | |
| public HostInfo | |
| public String | |
| public Log | Returns: the Log instance to use for logging messages.Returns the log mechanism that should be used to log information from/for this Session. |
| public <M extends Message> MessageBuilder | |
| public String | |
| public ProfilerEventHandler | Returns: theProfilerEventHandler object.Returns the current ProfilerEventHandler or initializes a new one if none exists. |
| public PropertySet | |
| public String | Returns: query comment stringReturns the comment that will be prepended to all statements sent to the server. |
| public String | |
| public SocketAddress | |
| public ServerSession | |
| public Lock | |
| public TelemetryHandler | |
| public long | |
| public boolean | |
| public boolean | |
| public boolean | |
| public default < Message type M extends Message, Row type R, Result type RES> RES | |
| public default < Message type M extends Message, Result type R extends QueryResult> R | Returns: QueryResult objectquery message message, ResultBuilder<R> ResultBuilder instance resultBuilder)Synchronously query database. |
| public default < Message type M extends Message, Result type R extends QueryResult> CompletableFuture | Returns: CompletableFuture providing aQueryResult objectquery message message, ResultBuilder<R> ResultBuilder instance resultBuilder)Asynchronously query database. |
| public void | |
| public void | removeListener(Session.
SessionEventListener instance.Remove session listener. |
| public void | |
| public void | setQueryComment(String
query comment string comment)Sets the comment that will be prepended to all statements sent to the server. |
| public void | |
| public boolean | Returns: true if current server version equal or higher than provided onemajor version number major, int minor version number minor, int sub-minor version number subminor)Does the version of the MySQL server we are connected to meet the given minimums? |
| addListener | back to summary |
|---|---|
| public void addListener(Session. Add listener for this session status changes.
| |
| changeUser | back to summary |
|---|---|
| public void changeUser(String userName, String password, String database) Re-authenticates as the given user and password | |
| forceClose | back to summary |
|---|---|
| public void forceClose() Clobbers the physical network connection and marks this session as closed. | |
| getDataStoreMetadata | back to summary |
|---|---|
| public DataStoreMetadata getDataStoreMetadata() | |
| getExceptionInterceptor | back to summary |
|---|---|
| public ExceptionInterceptor getExceptionInterceptor() | |
| getHostInfo | back to summary |
|---|---|
| public HostInfo getHostInfo() | |
| getIdentifierQuoteString | back to summary |
|---|---|
| public String getIdentifierQuoteString() | |
| getLog | back to summary |
|---|---|
| public Log getLog() Returns the log mechanism that should be used to log information from/for this Session.
| |
| getMessageBuilder | back to summary |
|---|---|
| public <M extends Message> MessageBuilder | |
| getProcessHost | back to summary |
|---|---|
| public String getProcessHost() | |
| getProfilerEventHandler | back to summary |
|---|---|
| public ProfilerEventHandler getProfilerEventHandler() Returns the current ProfilerEventHandler or initializes a new one if none exists.
| |
| getPropertySet | back to summary |
|---|---|
| public PropertySet getPropertySet() | |
| getQueryComment | back to summary |
|---|---|
| public String getQueryComment() Returns the comment that will be prepended to all statements sent to the server.
| |
| getQueryTimingUnits | back to summary |
|---|---|
| public String getQueryTimingUnits() | |
| getRemoteSocketAddress | back to summary |
|---|---|
| public SocketAddress getRemoteSocketAddress() | |
| getServerSession | back to summary |
|---|---|
| public ServerSession getServerSession() | |
| getSessionLock | back to summary |
|---|---|
| public Lock getSessionLock() | |
| getTelemetryHandler | back to summary |
|---|---|
| public TelemetryHandler getTelemetryHandler() | |
| getThreadId | back to summary |
|---|---|
| public long getThreadId() | |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() | |
| isSetNeededForAutoCommitMode | back to summary |
|---|---|
| public boolean isSetNeededForAutoCommitMode(boolean autoCommitFlag) | |
| isSSLEstablished | back to summary |
|---|---|
| public boolean isSSLEstablished() | |
| query | back to summary |
|---|---|
| public default <M extends Message, R, RES> RES query(M message, Predicate<Row> rowFilter, Function<Row, R> rowMapper, Collector<R, ?, RES> collector) Synchronously query database with applying rows filtering and mapping. | |
| query | back to summary |
|---|---|
| public default <M extends Message, R extends QueryResult> R query(M message, ResultBuilder<R> resultBuilder) Synchronously query database.
| |
| queryAsync | back to summary |
|---|---|
| public default <M extends Message, R extends QueryResult> CompletableFuture Asynchronously query database.
| |
| quit | back to summary |
|---|---|
| public void quit() Log-off of the MySQL server and close the socket. | |
| removeListener | back to summary |
|---|---|
| public void removeListener(Session. Remove session listener.
| |
| setExceptionInterceptor | back to summary |
|---|---|
| public void setExceptionInterceptor(ExceptionInterceptor exceptionInterceptor) | |
| setQueryComment | back to summary |
|---|---|
| public void setQueryComment(String comment) Sets the comment that will be prepended to all statements sent to the server. Do not use slash-star or star-slash tokens in the comment as these will be added by the driver itself.
| |
| setTelemetryHandler | back to summary |
|---|---|
| public void setTelemetryHandler(TelemetryHandler telemetryHandler) | |
| versionMeetsMinimum | back to summary |
|---|---|
| public boolean versionMeetsMinimum(int major, int minor, int subminor) Does the version of the MySQL server we are connected to meet the given minimums?
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void |
| handleCleanup | back to summary |
|---|---|
| public void handleCleanup(Throwable whyCleanedUp) | |
| handleNormalClose | back to summary |
|---|---|
| public void handleNormalClose() | |
| handleReconnect | back to summary |
|---|---|
| public void handleReconnect() | |