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

org.elasticmq.persistence.sql.DB.scala Maven / Gradle / Ivy

package org.elasticmq.persistence.sql
import scalikejdbc.ConnectionPool

class DB(val persistenceConfig: SqlQueuePersistenceConfig) {
  DB.initializeSingleton(persistenceConfig)
}

object DB {
  private var initialized = false

  def initializeSingleton(persistenceConfig: SqlQueuePersistenceConfig): Unit = {
    if (!initialized) {
      Class.forName(persistenceConfig.driverClass)
      ConnectionPool.singleton(persistenceConfig.uri, persistenceConfig.username, persistenceConfig.password)
      initialized = true
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy