## com.mysql.jdbc
Class CommunicationsException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.sql.SQLException
                  com.mysql.jdbc.CommunicationsException

All Implemented Interfaces:
  StreamingNotifiable, java.io.Serializable, java.lang.Iterable<java.lang.Throwable>

Direct Known Subclasses:
  ConnectionFeatureNotAvailableException

    public class CommunicationsException

extends java.sql.SQLException
implements StreamingNotifiable

An exception to represent communications errors with the database. Attempts to provide 'friendler' error messages to end-users, including last time a packet was sent to the database, what the client-timeout is set to, and whether the idle time has been exceeded.

See Also:
  Serialized Form

Field Summary
`(package private) static long` `serialVersionUID`

Constructor Summary
`CommunicationsException(MySQLConnection conn, long lastPacketSentTimeMs, long lastPacketReceivedTimeMs, java.lang.Exception underlyingException)`

Method Summary
`java.lang.String` `getMessage()`
`java.lang.String` `getSQLState()`
`void` `setWasStreamingResults()`

Methods inherited from class java.sql.SQLException
`getErrorCode, getNextException, iterator, setNextException`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

Field Detail

### serialVersionUID

    static final long serialVersionUID

See Also:
  Constant Field Values

Constructor Detail

### CommunicationsException

    public CommunicationsException(MySQLConnection conn,
                                   long lastPacketSentTimeMs,
                                   long lastPacketReceivedTimeMs,
                                   java.lang.Exception underlyingException)

Method Detail

### getMessage

    public java.lang.String getMessage()

  Overrides:
    `getMessage` in class `java.lang.Throwable`

### getSQLState

    public java.lang.String getSQLState()

  Overrides:
    `getSQLState` in class `java.sql.SQLException`

### setWasStreamingResults

    public void setWasStreamingResults()

  Specified by:
    `setWasStreamingResults` in interface `StreamingNotifiable`