title: Spring Boot - the best way to read data from database on startup
body: <p>I would like to read data to List or Map from database on startup.
  Which is the best way to do it? The Spring Boot version is 5.</p>
  
  <p>Is the below solution is good?</p>
  
  <pre><code>@Component
  public class ApplicationStartup 
  implements ApplicationListener&lt;ApplicationReadyEvent&gt; {
  
    /**
     * This event is executed as late as conceivably possible to indicate that 
     * the application is ready to service requests.
     */
    @Override
    public void onApplicationEvent(final ApplicationReadyEvent event) {
  
      // here your code ...
  
      return;
    }
  
  } 
  </code></pre>
  
  <p>I'd like to storage data on static class, but I have doubt that is the best solution.</p>