code: public String getClientInfo(final String name) throws SQLException {
      checkConnection();
      if (!"ApplicationName".equals(name) && !"ClientUser".equals(name) && !"ClientHostname"
          .equals(name)) {
        throw new SQLException(
            "name must be \"ApplicationName\", \"ClientUser\" or \"ClientHostname\", but was \""
                + name + "\"");
      }
      try (Statement statement = createStatement()) {
        try (ResultSet rs = statement.executeQuery("SELECT @" + name)) {
          if (rs.next()) {
            return rs.getString(1);
          }
        }
      }
      return null;
    }
docs: Returns the value of the client info property specified by name.  This method may return null
  if the specified client info property has not been set and does not have a default value.  This
  method will also return null if the specified client info property name is not supported by the
  driver. Applications may use the <code>DatabaseMetaData.getClientInfoProperties</code> method
  to determine the client info properties supported by the driver.
  
  @param name The name of the client info property to retrieve
  @return The value of the client info property specified
  @throws SQLException if the database server returns an error when fetching the client info
  value from the database or this method is called on a closed connection
  @see DatabaseMetaData#getClientInfoProperties
  @since 1.6