## com.mysql.jdbc
Class MysqlIO

    java.lang.Object
      com.mysql.jdbc.MysqlIO

    public class MysqlIO

extends java.lang.Object

This class is used by Connection for communicating with the MySQL server.

See Also:
  `Connection`

Field Summary
`protected static int` `AUTH_411_OVERHEAD`
`protected static int` `CLIENT_CONNECT_WITH_DB`
`protected static int` `CLIENT_RESERVED`
`protected static int` `CLIENT_SECURE_CONNECTION`
`protected static int` `CLIENT_SSL`
`protected long` `clientParam`
`protected static int` `COMP_HEADER_LENGTH`
`protected MySQLConnection` `connection`
`protected static int` `HEADER_LENGTH`
`protected java.lang.String` `host`
`protected static int` `INITIAL_PACKET_SIZE`
`protected long` `lastPacketReceivedTimeMs`
`protected long` `lastPacketSentTimeMs`
`protected static int` `MAX_QUERY_SIZE_TO_EXPLAIN`
`protected static int` `MAX_QUERY_SIZE_TO_LOG`
`protected int` `maxThreeBytes`
`protected static int` `MIN_COMPRESS_LEN`
`protected java.net.Socket` `mysqlConnection` The connection to the server
`protected java.io.InputStream` `mysqlInput`
`protected java.io.BufferedOutputStream` `mysqlOutput` Data to the server
`protected static int` `NULL_LENGTH`
`protected int` `port`
`protected java.lang.String` `seed`
`(package private) static int` `SERVER_MORE_RESULTS_EXISTS`
`protected int` `serverCapabilities`
`protected int` `serverCharsetIndex`
`protected SocketFactory` `socketFactory`
`protected static java.lang.String` `ZERO_DATE_VALUE_MARKER` We need to have a 'marker' for all-zero datetimes so that ResultSet can decide what to do based on connection setting
`protected static java.lang.String` `ZERO_DATETIME_VALUE_MARKER`

Constructor Summary
`MysqlIO(java.lang.String host, int port, java.util.Properties props, java.lang.String socketFactoryClassName, MySQLConnection conn, int socketTimeout, int useBufferRowSizeThreshold)` Constructor: Connect to the MySQL server and setup a stream connection.

Method Summary
`protected void` `changeUser(java.lang.String userName, java.lang.String password, java.lang.String database)` Re-authenticates as the given user and password
`protected Buffer` `checkErrorPacket()` Checks for errors in the reply packet, and if none, returns the reply packet, ready for reading
`protected void` `checkForCharsetMismatch()` Determines if the database charset is the same as the platform charset
`protected void` `clearInputStream()`
`(package private) void` `closeStreamer(RowData streamer)`
`(package private) void` `disableMultiQueries()`
`(package private) void` `doHandshake(java.lang.String user, java.lang.String password, java.lang.String database)` Initialize communications with the MySQL server.
`protected void` `dumpPacketRingBuffer()`
`(package private) void` `enableMultiQueries()`
`protected void` `explainSlowQuery(byte[] querySQL, java.lang.String truncatedQuery)` Runs an 'EXPLAIN' on the given query and dumps the results to the log
`protected java.util.List<ResultSetRow>` `fetchRowsViaCursor(java.util.List<ResultSetRow> fetchedRows, long statementId, Field[] columnTypes, int fetchSize, boolean useBufferRowExplicit)`
`protected void` `forceClose()` Forcibly closes the underlying socket to MySQL.
`protected int` `getCommandCount()`
`protected long` `getCurrentTimeNanosOrMillis()`
`protected ExceptionInterceptor` `getExceptionInterceptor()`
`(package private) java.lang.String` `getHost()` Returns the host this IO is connected to
`protected long` `getLastPacketReceivedTimeMs()`
`protected long` `getLastPacketSentTimeMs()` DOCUMENT ME!
`(package private) static int` `getMaxBuf()`
`protected NetworkResources` `getNetworkResources()`
`protected java.lang.String` `getQueryTimingUnits()`
`protected ResultSetImpl` `getResultSet(StatementImpl callingStatement, long columnCount, int maxRows, int resultSetType, int resultSetConcurrency, boolean streamResults, java.lang.String catalog, boolean isBinaryEncoded, Field[] metadataFromCache)` Build a result set.
`(package private) int` `getServerMajorVersion()` Get the major version of the MySQL server we are talking to.
`(package private) int` `getServerMinorVersion()` Get the minor version of the MySQL server we are talking to.
`protected int` `getServerStatus()`
`(package private) int` `getServerSubMinorVersion()` Get the sub-minor version of the MySQL server we are talking to.
`(package private) java.lang.String` `getServerVersion()` Get the version string of the server we are talking to
`(package private) Buffer` `getSharedSendPacket()` Returns the packet used for sending data (used by PreparedStatement) Guarded by external synchronization on a mutex.
`protected long` `getSlowQueryThreshold()`
`protected long` `getThreadId()`
`(package private) boolean` `hadWarnings()`
`boolean` `hasLongColumnInfo()` Does the server send back extra column info?
`protected boolean` `inTransactionOnServer()`
`(package private) ResultSetInternalMethods` `invokeStatementInterceptorsPost(java.lang.String sql, Statement interceptedStatement, ResultSetInternalMethods originalResultSet, boolean forceExecute, java.sql.SQLException statementException)`
`(package private) ResultSetInternalMethods` `invokeStatementInterceptorsPre(java.lang.String sql, Statement interceptedStatement, boolean forceExecute)`
`protected boolean` `isDataAvailable()`
`protected boolean` `isSetNeededForAutoCommitMode(boolean autoCommitFlag)`
`(package private) boolean` `isVersion(int major, int minor, int subminor)` Is the version of the MySQL server we are connected to the given version?
`(package private) ResultSetRow` `nextRow(Field[] fields, int columnCount, boolean isBinaryEncoded, int resultSetConcurrency, boolean useBufferRowIfPossible, boolean useBufferRowExplicit, boolean canReuseRowPacketForBufferRow, Buffer existingRowPacket)` Retrieve one row from the MySQL server.
`(package private) ResultSetRow` `nextRowFast(Field[] fields, int columnCount, boolean isBinaryEncoded, int resultSetConcurrency, boolean useBufferRowIfPossible, boolean useBufferRowExplicit, boolean canReuseRowPacket)`
`(package private) void` `quit()` Log-off of the MySQL server and close the socket.
`(package private) ResultSetImpl` `readAllResults(StatementImpl callingStatement, int maxRows, int resultSetType, int resultSetConcurrency, boolean streamResults, java.lang.String catalog, Buffer resultPacket, boolean isBinaryEncoded, long preSentColumnCount, Field[] metadataFromCache)`
`protected Buffer` `readPacket()` Read one packet from the MySQL server

`protected ResultSetImpl`

`readResultsForQueryOrUpdate(StatementImpl callingStatement, int maxRows, int resultSetType, int resultSetConcurrency, boolean streamResults, java.lang.String catalog, Buffer resultPacket, boolean isBinaryEncoded, long preSentColumnCount, Field[] metadataFromCache)`
Reads one result set off of the wire, if the result is actually an update count, creates an update-count only result set.

`(package private) void` `resetMaxBuf()` Sets the buffer size to max-buf
`protected void` `resetReadPacketSequence()`
`(package private) void` `scanForAndThrowDataTruncation()`
`(package private) void` `secureAuth411(Buffer packet, int packLength, java.lang.String user, java.lang.String password, java.lang.String database, boolean writeClientParams)` Secure authentication for 4.1.1 and newer servers.
`(package private) Buffer` `sendCommand(int command, java.lang.String extraData, Buffer queryPacket, boolean skipCheck, java.lang.String extraDataCharEncoding, int timeoutMillis)` Send a command to the MySQL server If data is to be sent with command, it should be put in extraData.
`protected void` `setSocketTimeout(int milliseconds)`
`protected void` `setStatementInterceptors(java.util.List<StatementInterceptorV2> statementInterceptors)`
`protected boolean` `shouldIntercept()`
`protected void` `skipPacket()` Reads and discards a single MySQL packet from the input stream.
`(package private) ResultSetInternalMethods` `sqlQueryDirect(StatementImpl callingStatement, java.lang.String query, java.lang.String characterEncoding, Buffer queryPacket, int maxRows, int resultSetType, int resultSetConcurrency, boolean streamResults, java.lang.String catalog, Field[] cachedMetadata)` Send a query stored in a packet directly to the server.
`(package private) boolean` `tackOnMoreStreamingResults(ResultSetImpl addingTo)`
`protected Field` `unpackField(Buffer packet, boolean extractDefaultValues)` Unpacks the Field information from the given packet.
`static boolean` `useBufferRowExplicit(Field[] fields)`
`protected boolean` `useNanosForElapsedTime()`
`(package private) boolean` `versionMeetsMinimum(int major, int minor, int subminor)` Does the version of the MySQL server we are connected to meet the given minimums?

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NULL_LENGTH

    protected static final int NULL_LENGTH

See Also:
  Constant Field Values

### COMP_HEADER_LENGTH

    protected static final int COMP_HEADER_LENGTH

See Also:
  Constant Field Values

### MIN_COMPRESS_LEN

    protected static final int MIN_COMPRESS_LEN

See Also:
  Constant Field Values

### HEADER_LENGTH

    protected static final int HEADER_LENGTH

See Also:
  Constant Field Values

### AUTH_411_OVERHEAD

    protected static final int AUTH_411_OVERHEAD

See Also:
  Constant Field Values

### CLIENT_CONNECT_WITH_DB

    protected static final int CLIENT_CONNECT_WITH_DB

See Also:
  Constant Field Values

### CLIENT_SSL

    protected static final int CLIENT_SSL

See Also:
  Constant Field Values

### CLIENT_RESERVED

    protected static final int CLIENT_RESERVED

See Also:
  Constant Field Values

### CLIENT_SECURE_CONNECTION

    protected static final int CLIENT_SECURE_CONNECTION

See Also:
  Constant Field Values

### SERVER_MORE_RESULTS_EXISTS

    static final int SERVER_MORE_RESULTS_EXISTS

See Also:
  Constant Field Values

### MAX_QUERY_SIZE_TO_LOG

    protected static final int MAX_QUERY_SIZE_TO_LOG

See Also:
  Constant Field Values

### MAX_QUERY_SIZE_TO_EXPLAIN

    protected static final int MAX_QUERY_SIZE_TO_EXPLAIN

See Also:
  Constant Field Values

### INITIAL_PACKET_SIZE

    protected static final int INITIAL_PACKET_SIZE

See Also:
  Constant Field Values

### ZERO_DATE_VALUE_MARKER

    protected static final java.lang.String ZERO_DATE_VALUE_MARKER

  We need to have a 'marker' for all-zero datetimes so that ResultSet can decide what to do based on connection setting

  See Also:
    Constant Field Values

### ZERO_DATETIME_VALUE_MARKER

    protected static final java.lang.String ZERO_DATETIME_VALUE_MARKER

See Also:
  Constant Field Values

### serverCharsetIndex

    protected int serverCharsetIndex

### mysqlOutput

    protected java.io.BufferedOutputStream mysqlOutput

  Data to the server

### connection

    protected MySQLConnection connection

### mysqlInput

    protected java.io.InputStream mysqlInput

### mysqlConnection

    protected java.net.Socket mysqlConnection

  The connection to the server

### socketFactory

    protected SocketFactory socketFactory

### host

    protected java.lang.String host

### seed

    protected java.lang.String seed

### maxThreeBytes

    protected int maxThreeBytes

### port

    protected int port

### serverCapabilities

    protected int serverCapabilities

### clientParam

    protected long clientParam

### lastPacketSentTimeMs

    protected long lastPacketSentTimeMs

### lastPacketReceivedTimeMs

    protected long lastPacketReceivedTimeMs

Constructor Detail

### MysqlIO

    public MysqlIO(java.lang.String host,
                   int port,
                   java.util.Properties props,
                   java.lang.String socketFactoryClassName,
                   MySQLConnection conn,
                   int socketTimeout,
                   int useBufferRowSizeThreshold)
            throws java.io.IOException,
                   java.sql.SQLException

  Constructor: Connect to the MySQL server and setup a stream connection.

  Parameters:
    `host` - the hostname to connect to
    `port` - the port number that the server is listening on
    `props` - the Properties from DriverManager.getConnection()
    `socketFactoryClassName` - the socket factory to use
    `conn` - the Connection that is creating us
    `socketTimeout` - the timeout to set for the socket (0 means no timeout)
  Throws:
    `java.io.IOException` - if an IOException occurs during connect.
    `java.sql.SQLException` - if a database access error occurs.

Method Detail

### hasLongColumnInfo

    public boolean hasLongColumnInfo()

  Does the server send back extra column info?

  Returns:
    true if so

### isDataAvailable

    protected boolean isDataAvailable()
                               throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getLastPacketSentTimeMs

    protected long getLastPacketSentTimeMs()

  DOCUMENT ME!

  Returns:
    Returns the lastPacketSentTimeMs.

### getLastPacketReceivedTimeMs

    protected long getLastPacketReceivedTimeMs()

### getResultSet

    protected ResultSetImpl getResultSet(StatementImpl callingStatement,
                                         long columnCount,
                                         int maxRows,
                                         int resultSetType,
                                         int resultSetConcurrency,
                                         boolean streamResults,
                                         java.lang.String catalog,
                                         boolean isBinaryEncoded,
                                         Field[] metadataFromCache)
                                  throws java.sql.SQLException

  Build a result set. Delegates to buildResultSetWithRows() to build a JDBC-version-specific ResultSet, given rows as byte data, and field information.

  Parameters:
    `callingStatement` - DOCUMENT ME!
    `columnCount` - the number of columns in the result set
    `maxRows` - the maximum number of rows to read (-1 means all rows)
    `resultSetType` - (TYPE_FORWARD_ONLY, TYPE_SCROLL_????)
    `resultSetConcurrency` - the type of result set (CONCUR_UPDATABLE or READ_ONLY)
    `streamResults` - should the result set be read all at once, or streamed?
    `catalog` - the database name in use when the result set was created
    `isBinaryEncoded` - is this result set in native encoding?
    `unpackFieldInfo` - should we read MYSQL_FIELD info (if available)?
  Returns:
    a result set
  Throws:
    `java.sql.SQLException` - if a database access error occurs

### getNetworkResources

    protected NetworkResources getNetworkResources()

### forceClose

    protected final void forceClose()

  Forcibly closes the underlying socket to MySQL.

### skipPacket

    protected final void skipPacket()
                             throws java.sql.SQLException

  Reads and discards a single MySQL packet from the input stream.

  Throws:
    `java.sql.SQLException` - if the network fails while skipping the packet.

### readPacket

    protected final Buffer readPacket()
                               throws java.sql.SQLException

  Read one packet from the MySQL server

  Returns:
    the packet from the server.
  Throws:
    `java.sql.SQLException` - DOCUMENT ME!
    `CommunicationsException` - DOCUMENT ME!

### unpackField

    protected final Field unpackField(Buffer packet,
                                      boolean extractDefaultValues)
                               throws java.sql.SQLException

  Unpacks the Field information from the given packet. Understands pre 4.1 and post 4.1 server version field packet structures.

  Parameters:
    `packet` - the packet containing the field information
    `extractDefaultValues` - should default values be extracted?
  Returns:
    the unpacked field
  Throws:
    `java.sql.SQLException` - DOCUMENT ME!

### isSetNeededForAutoCommitMode

    protected boolean isSetNeededForAutoCommitMode(boolean autoCommitFlag)

### inTransactionOnServer

    protected boolean inTransactionOnServer()

### changeUser

    protected void changeUser(java.lang.String userName,
                              java.lang.String password,
                              java.lang.String database)
                       throws java.sql.SQLException

  Re-authenticates as the given user and password

  Parameters:
    `userName` - DOCUMENT ME!
    `password` - DOCUMENT ME!
    `database` - DOCUMENT ME!
  Throws:
    `java.sql.SQLException` - DOCUMENT ME!

### checkErrorPacket

    protected Buffer checkErrorPacket()
                               throws java.sql.SQLException

  Checks for errors in the reply packet, and if none, returns the reply packet, ready for reading

  Returns:
    a packet ready for reading.
  Throws:
    `java.sql.SQLException` - is the packet is an error packet

### checkForCharsetMismatch

    protected void checkForCharsetMismatch()

  Determines if the database charset is the same as the platform charset

### clearInputStream

    protected void clearInputStream()
                             throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### resetReadPacketSequence

    protected void resetReadPacketSequence()

### dumpPacketRingBuffer

    protected void dumpPacketRingBuffer()
                                 throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### explainSlowQuery

    protected void explainSlowQuery(byte[] querySQL,
                                    java.lang.String truncatedQuery)
                             throws java.sql.SQLException

  Runs an 'EXPLAIN' on the given query and dumps the results to the log

  Parameters:
    `querySQL` - DOCUMENT ME!
    `truncatedQuery` - DOCUMENT ME!
  Throws:
    `java.sql.SQLException` - DOCUMENT ME!

### getMaxBuf

    static int getMaxBuf()

### getServerMajorVersion

    final int getServerMajorVersion()

  Get the major version of the MySQL server we are talking to.

  Returns:
    DOCUMENT ME!

### getServerMinorVersion

    final int getServerMinorVersion()

  Get the minor version of the MySQL server we are talking to.

  Returns:
    DOCUMENT ME!

### getServerSubMinorVersion

    final int getServerSubMinorVersion()

  Get the sub-minor version of the MySQL server we are talking to.

  Returns:
    DOCUMENT ME!

### getServerVersion

    java.lang.String getServerVersion()

  Get the version string of the server we are talking to

  Returns:
    DOCUMENT ME!

### doHandshake

    void doHandshake(java.lang.String user,
                     java.lang.String password,
                     java.lang.String database)
               throws java.sql.SQLException

  Initialize communications with the MySQL server. Handles logging on, and handling initial connection errors.

  Parameters:
    `user` - DOCUMENT ME!
    `password` - DOCUMENT ME!
    `database` - DOCUMENT ME!
  Throws:
    `java.sql.SQLException` - DOCUMENT ME!
    `CommunicationsException` - DOCUMENT ME!

### nextRow

    final ResultSetRow nextRow(Field[] fields,
                               int columnCount,
                               boolean isBinaryEncoded,
                               int resultSetConcurrency,
                               boolean useBufferRowIfPossible,
                               boolean useBufferRowExplicit,
                               boolean canReuseRowPacketForBufferRow,
                               Buffer existingRowPacket)
                        throws java.sql.SQLException

  Retrieve one row from the MySQL server. Note: this method is not thread-safe, but it is only called from methods that are guarded by synchronizing on this object.

  Parameters:
    `fields` - DOCUMENT ME!
    `columnCount` - DOCUMENT ME!
    `isBinaryEncoded` - DOCUMENT ME!
    `resultSetConcurrency` - DOCUMENT ME!
    `b` -
  Returns:
    DOCUMENT ME!
  Throws:
    `java.sql.SQLException` - DOCUMENT ME!

### nextRowFast

    final ResultSetRow nextRowFast(Field[] fields,
                                   int columnCount,
                                   boolean isBinaryEncoded,
                                   int resultSetConcurrency,
                                   boolean useBufferRowIfPossible,
                                   boolean useBufferRowExplicit,
                                   boolean canReuseRowPacket)
                            throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### quit

    final void quit()
             throws java.sql.SQLException

  Log-off of the MySQL server and close the socket.

  Throws:
    `java.sql.SQLException` - DOCUMENT ME!

### getSharedSendPacket

    Buffer getSharedSendPacket()

  Returns the packet used for sending data (used by PreparedStatement) Guarded by external synchronization on a mutex.

  Returns:
    A packet to send data with

### closeStreamer

    void closeStreamer(RowData streamer)
                 throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### tackOnMoreStreamingResults

    boolean tackOnMoreStreamingResults(ResultSetImpl addingTo)
                                 throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### readAllResults

    ResultSetImpl readAllResults(StatementImpl callingStatement,
                                 int maxRows,
                                 int resultSetType,
                                 int resultSetConcurrency,
                                 boolean streamResults,
                                 java.lang.String catalog,
                                 Buffer resultPacket,
                                 boolean isBinaryEncoded,
                                 long preSentColumnCount,
                                 Field[] metadataFromCache)
                           throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### resetMaxBuf

    void resetMaxBuf()

  Sets the buffer size to max-buf

### sendCommand

    final Buffer sendCommand(int command,
                             java.lang.String extraData,
                             Buffer queryPacket,
                             boolean skipCheck,
                             java.lang.String extraDataCharEncoding,
                             int timeoutMillis)
                      throws java.sql.SQLException

  Send a command to the MySQL server If data is to be sent with command, it should be put in extraData. Raw packets can be sent by setting queryPacket to something other than null.

  Parameters:
    `command` - the MySQL protocol 'command' from MysqlDefs
    `extraData` - any 'string' data for the command
    `queryPacket` - a packet pre-loaded with data for the protocol (i.e. from a client-side prepared statement).
    `skipCheck` - do not call checkErrorPacket() if true
    `extraDataCharEncoding` - the character encoding of the extraData parameter.
  Returns:
    the response packet from the server
  Throws:
    `java.sql.SQLException` - if an I/O error or SQL error occurs

### shouldIntercept

    protected boolean shouldIntercept()

### sqlQueryDirect

    final ResultSetInternalMethods sqlQueryDirect(StatementImpl callingStatement,
                                                  java.lang.String query,
                                                  java.lang.String characterEncoding,
                                                  Buffer queryPacket,
                                                  int maxRows,
                                                  int resultSetType,
                                                  int resultSetConcurrency,
                                                  boolean streamResults,
                                                  java.lang.String catalog,
                                                  Field[] cachedMetadata)
                                           throws java.lang.Exception

  Send a query stored in a packet directly to the server.

  Parameters:
    `callingStatement` - DOCUMENT ME!
    `resultSetConcurrency` - DOCUMENT ME!
    `characterEncoding` - DOCUMENT ME!
    `queryPacket` - DOCUMENT ME!
    `maxRows` - DOCUMENT ME!
    `conn` - DOCUMENT ME!
    `resultSetType` - DOCUMENT ME!
    `resultSetConcurrency` - DOCUMENT ME!
    `streamResults` - DOCUMENT ME!
    `catalog` - DOCUMENT ME!
    `unpackFieldInfo` - should we read MYSQL_FIELD info (if available)?
  Returns:
    DOCUMENT ME!
  Throws:
    `java.lang.Exception` - DOCUMENT ME!

### invokeStatementInterceptorsPre

    ResultSetInternalMethods invokeStatementInterceptorsPre(java.lang.String sql,
                                                            Statement interceptedStatement,
                                                            boolean forceExecute)
                                                      throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### invokeStatementInterceptorsPost

    ResultSetInternalMethods invokeStatementInterceptorsPost(java.lang.String sql,
                                                             Statement interceptedStatement,
                                                             ResultSetInternalMethods originalResultSet,
                                                             boolean forceExecute,
                                                             java.sql.SQLException statementException)
                                                       throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getCurrentTimeNanosOrMillis

    protected long getCurrentTimeNanosOrMillis()

### getHost

    java.lang.String getHost()

  Returns the host this IO is connected to

  Returns:
    DOCUMENT ME!

### isVersion

    boolean isVersion(int major,
                      int minor,
                      int subminor)

  Is the version of the MySQL server we are connected to the given version?

  Parameters:
    `major` - the major version
    `minor` - the minor version
    `subminor` - the subminor version
  Returns:
    true if the version of the MySQL server we are connected is the given version

### versionMeetsMinimum

    boolean versionMeetsMinimum(int major,
                                int minor,
                                int subminor)

  Does the version of the MySQL server we are connected to meet the given minimums?

  Parameters:
    `major` - DOCUMENT ME!
    `minor` - DOCUMENT ME!
    `subminor` - DOCUMENT ME!
  Returns:
    DOCUMENT ME!

### readResultsForQueryOrUpdate

    protected final ResultSetImpl readResultsForQueryOrUpdate(StatementImpl callingStatement,
                                                              int maxRows,
                                                              int resultSetType,
                                                              int resultSetConcurrency,
                                                              boolean streamResults,
                                                              java.lang.String catalog,
                                                              Buffer resultPacket,
                                                              boolean isBinaryEncoded,
                                                              long preSentColumnCount,
                                                              Field[] metadataFromCache)
                                                       throws java.sql.SQLException

  Reads one result set off of the wire, if the result is actually an update count, creates an update-count only result set.

  Parameters:
    `callingStatement` - DOCUMENT ME!
    `maxRows` - the maximum rows to return in the result set.
    `resultSetType` - scrollability
    `resultSetConcurrency` - updatability
    `streamResults` - should the driver leave the results on the wire, and read them only when needed?
    `catalog` - the catalog in use
    `resultPacket` - the first packet of information in the result set
    `isBinaryEncoded` - is this result set from a prepared statement?
    `preSentColumnCount` - do we already know the number of columns?
    `unpackFieldInfo` - should we unpack the field information?
  Returns:
    a result set that either represents the rows, or an update count
  Throws:
    `java.sql.SQLException` - if an error occurs while reading the rows

### useBufferRowExplicit

    public static boolean useBufferRowExplicit(Field[] fields)

### enableMultiQueries

    void enableMultiQueries()
                      throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### disableMultiQueries

    void disableMultiQueries()
                       throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### hadWarnings

    boolean hadWarnings()

### scanForAndThrowDataTruncation

    void scanForAndThrowDataTruncation()
                                 throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### secureAuth411

    void secureAuth411(Buffer packet,
                       int packLength,
                       java.lang.String user,
                       java.lang.String password,
                       java.lang.String database,
                       boolean writeClientParams)
                 throws java.sql.SQLException

  Secure authentication for 4.1.1 and newer servers.

  Parameters:
    `packet` - DOCUMENT ME!
    `packLength` -
    `user` -
    `password` -
    `database` - DOCUMENT ME!
    `writeClientParams` -
  Throws:
    `java.sql.SQLException`

### getServerStatus

    protected int getServerStatus()

### fetchRowsViaCursor

    protected java.util.List<ResultSetRow> fetchRowsViaCursor(java.util.List<ResultSetRow> fetchedRows,
                                                              long statementId,
                                                              Field[] columnTypes,
                                                              int fetchSize,
                                                              boolean useBufferRowExplicit)
                                                       throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getThreadId

    protected long getThreadId()

### useNanosForElapsedTime

    protected boolean useNanosForElapsedTime()

### getSlowQueryThreshold

    protected long getSlowQueryThreshold()

### getQueryTimingUnits

    protected java.lang.String getQueryTimingUnits()

### getCommandCount

    protected int getCommandCount()

### setStatementInterceptors

    protected void setStatementInterceptors(java.util.List<StatementInterceptorV2> statementInterceptors)

### getExceptionInterceptor

    protected ExceptionInterceptor getExceptionInterceptor()

### setSocketTimeout

    protected void setSocketTimeout(int milliseconds)
                             throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`