code: public void stopServer() throws Exception {
          if (!externalDatabaseHost) {
              try (Connection sqlConnection = getConnection()) {
                  sqlConnection.prepareStatement("SHUTDOWN").execute();
              } catch (Exception e) {
              }
  
              try {
                  server.stop();
              } catch (Exception e) {
              }
          }
      }
docs: Shutdown the server
  
  @throws Exception exception