Package org.mariadb.jdbc.client.impl

## Class StandardClient

- java.lang.Object
- - org.mariadb.jdbc.client.impl.StandardClient

All Implemented Interfaces:
  `AutoCloseable`, `org.mariadb.jdbc.client.Client`

Direct Known Subclasses:
  `ReplayClient`

    public class StandardClient
    extends Object
    implements org.mariadb.jdbc.client.Client, AutoCloseable

### Field Summary

Fields
`protected org.mariadb.jdbc.client.Context` `context`
`protected ExceptionFactory` `exceptionFactory`
`protected Writer` `writer`

### Constructor Summary

Constructors
`StandardClient​(Configuration conf, HostAddress hostAddress, ReentrantLock lock, boolean skipPostCommands)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `abort​(Executor executor)`
`protected void` `checkNotClosed()`
`void` `close()`
`void` `closePrepare​(Prepare prepare)`
`String` `createSessionVariableQuery​(String serverTz)`
`protected void` `destroySocket()` Closing socket in case of Connection error after socket creation.
`List<org.mariadb.jdbc.client.Completion>` `execute​(org.mariadb.jdbc.message.ClientMessage message)`
`List<org.mariadb.jdbc.client.Completion>` `execute​(org.mariadb.jdbc.message.ClientMessage message, Statement stmt)`
`List<org.mariadb.jdbc.client.Completion>` `execute​(org.mariadb.jdbc.message.ClientMessage message, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion)`
`List<org.mariadb.jdbc.client.Completion>` `executePipeline​(org.mariadb.jdbc.message.ClientMessage[] messages, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion)`
`org.mariadb.jdbc.client.Context` `getContext()`
`ExceptionFactory` `getExceptionFactory()`
`HostAddress` `getHostAddress()`
`int` `getSocketTimeout()`
`int` `getWaitTimeout()`
`boolean` `isClosed()`
`boolean` `isPrimary()`
`org.mariadb.jdbc.client.Completion` `readPacket​(org.mariadb.jdbc.message.ClientMessage message)`
`org.mariadb.jdbc.client.Completion` `readPacket​(Statement stmt, org.mariadb.jdbc.message.ClientMessage message, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion)` Read server response packet.
`void` `readResponse​(org.mariadb.jdbc.message.ClientMessage message)`
`List<org.mariadb.jdbc.client.Completion>` `readResponse​(Statement stmt, org.mariadb.jdbc.message.ClientMessage message, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion)`
`void` `readStreamingResults​(List<org.mariadb.jdbc.client.Completion> completions, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion)`
`void` `reset()`
`int` `sendQuery​(org.mariadb.jdbc.message.ClientMessage message)`
`void` `setReadOnly​(boolean readOnly)`
`void` `setSocketTimeout​(int milliseconds)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### exceptionFactory

    protected final ExceptionFactory exceptionFactory

#### writer

    protected Writer writer

#### context

    protected org.mariadb.jdbc.client.Context context

### Constructor Detail

#### StandardClient

    public StandardClient​(Configuration conf,
                          HostAddress hostAddress,
                          ReentrantLock lock,
                          boolean skipPostCommands)
                   throws SQLException

Throws:
  `SQLException`

### Method Detail

#### destroySocket

    protected void destroySocket()

Closing socket in case of Connection error after socket creation.

#### createSessionVariableQuery

    public String createSessionVariableQuery​(String serverTz)

#### setReadOnly

    public void setReadOnly​(boolean readOnly)
                     throws SQLException

Specified by:
  `setReadOnly` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### sendQuery

    public int sendQuery​(org.mariadb.jdbc.message.ClientMessage message)
                  throws SQLException

Throws:
  `SQLException`

#### execute

    public List<org.mariadb.jdbc.client.Completion> execute​(org.mariadb.jdbc.message.ClientMessage message)
                                                     throws SQLException

Specified by:
  `execute` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### execute

    public List<org.mariadb.jdbc.client.Completion> execute​(org.mariadb.jdbc.message.ClientMessage message,
                                                            Statement stmt)
                                                     throws SQLException

Specified by:
  `execute` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### executePipeline

    public List<org.mariadb.jdbc.client.Completion> executePipeline​(org.mariadb.jdbc.message.ClientMessage[] messages,
                                                                    Statement stmt,
                                                                    int fetchSize,
                                                                    long maxRows,
                                                                    int resultSetConcurrency,
                                                                    int resultSetType,
                                                                    boolean closeOnCompletion)
                                                             throws SQLException

Specified by:
  `executePipeline` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### execute

    public List<org.mariadb.jdbc.client.Completion> execute​(org.mariadb.jdbc.message.ClientMessage message,
                                                            Statement stmt,
                                                            int fetchSize,
                                                            long maxRows,
                                                            int resultSetConcurrency,
                                                            int resultSetType,
                                                            boolean closeOnCompletion)
                                                     throws SQLException

Specified by:
  `execute` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### readResponse

    public List<org.mariadb.jdbc.client.Completion> readResponse​(Statement stmt,
                                                                 org.mariadb.jdbc.message.ClientMessage message,
                                                                 int fetchSize,
                                                                 long maxRows,
                                                                 int resultSetConcurrency,
                                                                 int resultSetType,
                                                                 boolean closeOnCompletion)
                                                          throws SQLException

Throws:
  `SQLException`

#### readResponse

    public void readResponse​(org.mariadb.jdbc.message.ClientMessage message)
                      throws SQLException

Throws:
  `SQLException`

#### closePrepare

    public void closePrepare​(Prepare prepare)
                      throws SQLException

Specified by:
  `closePrepare` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### readStreamingResults

    public void readStreamingResults​(List<org.mariadb.jdbc.client.Completion> completions,
                                     int fetchSize,
                                     long maxRows,
                                     int resultSetConcurrency,
                                     int resultSetType,
                                     boolean closeOnCompletion)
                              throws SQLException

Specified by:
  `readStreamingResults` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### readPacket

    public org.mariadb.jdbc.client.Completion readPacket​(org.mariadb.jdbc.message.ClientMessage message)
                                                  throws SQLException

Throws:
  `SQLException`

#### readPacket

    public org.mariadb.jdbc.client.Completion readPacket​(Statement stmt,
                                                         org.mariadb.jdbc.message.ClientMessage message,
                                                         int fetchSize,
                                                         long maxRows,
                                                         int resultSetConcurrency,
                                                         int resultSetType,
                                                         boolean closeOnCompletion)
                                                  throws SQLException

Read server response packet.

Parameters:
  `stmt` - current statement (null if internal)
  `message` - current message
  `fetchSize` - default fetch size
  `maxRows` - maximum row number
  `resultSetConcurrency` - concurrency
  `resultSetType` - type
  `closeOnCompletion` - must resultset close statement on completion
Returns:
  Completion
Throws:
  `SQLException` - if any exception
See Also:
  server response packets

#### checkNotClosed

    protected void checkNotClosed()
                           throws SQLException

Throws:
  `SQLException`

#### getWaitTimeout

    public int getWaitTimeout()

Specified by:
  `getWaitTimeout` in interface `org.mariadb.jdbc.client.Client`

#### isClosed

    public boolean isClosed()

Specified by:
  `isClosed` in interface `org.mariadb.jdbc.client.Client`

#### getContext

    public org.mariadb.jdbc.client.Context getContext()

Specified by:
  `getContext` in interface `org.mariadb.jdbc.client.Client`

#### abort

    public void abort​(Executor executor)
               throws SQLException

Specified by:
  `abort` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### getSocketTimeout

    public int getSocketTimeout()

Specified by:
  `getSocketTimeout` in interface `org.mariadb.jdbc.client.Client`

#### setSocketTimeout

    public void setSocketTimeout​(int milliseconds)
                          throws SQLException

Specified by:
  `setSocketTimeout` in interface `org.mariadb.jdbc.client.Client`
Throws:
  `SQLException`

#### close

    public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `org.mariadb.jdbc.client.Client`

#### isPrimary

    public boolean isPrimary()

Specified by:
  `isPrimary` in interface `org.mariadb.jdbc.client.Client`

#### getExceptionFactory

    public ExceptionFactory getExceptionFactory()

Specified by:
  `getExceptionFactory` in interface `org.mariadb.jdbc.client.Client`

#### getHostAddress

    public HostAddress getHostAddress()

Specified by:
  `getHostAddress` in interface `org.mariadb.jdbc.client.Client`

#### reset

    public void reset()

Specified by:
  `reset` in interface `org.mariadb.jdbc.client.Client`