Skip to content

Commit

Permalink
added connection pool
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Oct 21, 2024
1 parent d60d1fc commit 5b5aeb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions annosaurus/src/main/scala/org/mbari/annosaurus/AppConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.1
sbt.version=1.10.3

0 comments on commit 5b5aeb9

Please sign in to comment.