public Connection getConnection() throws SQLException {
    if (connection == null || connection.isClosed()) {
      try {
        if (connection != null) {
          Class.forName("com.mysql.jdbc.Driver").newInstance();
        }
        connection = DriverManager.getConnection(CONNECTION_URL);
      }
      catch (Exception e) {
        // error
        return null;
      }
    }
    return connection;
  }