title: Establishing a Connection Asynchronously
body: <p>I was told to run all of my MySQL connection processes on another thread besides the main thread to avoid the main thread from being stuck on a process that takes a few seconds to process.</p>
  
  <p>Therefore, I established a ConnectionPool in a separate thread, so that my GUI launches independently from the establishment of the connection. <strong>However, this is not the case. When I run the program, it waits until the connection is established and then it actually runs launch(args);</strong> My concern is why is it not running independently when a new thread is being established?</p>
  
  <pre><code>public static void main(String[] args) {
      initiateConnection();
      launch(args);
  }
  
  private static void initiateConnection() {
      new Thread(() -&gt; {
          try {
              connection = new ConnectionPool("jdbc:mysql://127.0.0.0/comm", "root",
                      "pass");
          } catch (Exception e) {
  
          }
      }).run();
  }
  </code></pre>