code: public static boolean isSqlStateConnectionException(SQLException se) {
          String sqlState = se.getSQLState();
          return sqlState != null && sqlState.startsWith("08");
      }
docs: Determines if the SQL exception is a connection exception
  
  @param se the exception
  @return true if it is a code 08nnn, otherwise false