diff --git a/annosaurus/src/main/scala/org/mbari/annosaurus/AppConfig.scala b/annosaurus/src/main/scala/org/mbari/annosaurus/AppConfig.scala index 24905edd..453673c8 100644 --- a/annosaurus/src/main/scala/org/mbari/annosaurus/AppConfig.scala +++ b/annosaurus/src/main/scala/org/mbari/annosaurus/AppConfig.scala @@ -87,6 +87,16 @@ case class DatabaseConfig( driver: String, queryView: String ): + lazy val dataSource = { + val ds = new com.zaxxer.hikari.HikariDataSource() + ds.setJdbcUrl(url) + ds.setUsername(user) + ds.setPassword(password) + ds.setDriverClassName(driver) + ds.setMaximumPoolSize(AppConfig.NumberOfVertxWorkers) + ds + } def newConnection(): java.sql.Connection = - Class.forName(driver) - java.sql.DriverManager.getConnection(url, user, password) + dataSource.getConnection() + // Class.forName(driver) + // java.sql.DriverManager.getConnection(url, user, password) diff --git a/project/build.properties b/project/build.properties index cb409aac..caeacc5e 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.1 \ No newline at end of file +sbt.version=1.10.3 \ No newline at end of file