All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openmetadata.service.resources.databases.DatasourceConfig Maven / Gradle / Ivy

There is a newer version: 1.5.11
Show newest version
package org.openmetadata.service.resources.databases;

import lombok.Getter;
import org.openmetadata.service.jdbi3.locator.ConnectionType;

public class DatasourceConfig {
  private static final DatasourceConfig instance = new DatasourceConfig();
  private static volatile boolean initialized = false;
  @Getter private static ConnectionType connectionType;

  private DatasourceConfig() {
    /* Private hidden constructor for singleton */
  }

  public static void initialize(String driverClass) {
    if (!initialized) {
      connectionType = ConnectionType.from(driverClass);
      initialized = true;
    }
  }

  public static DatasourceConfig getInstance() {
    return instance;
  }

  public Boolean isMySQL() {
    return ConnectionType.MYSQL.equals(connectionType);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy