Permalink
Browse files

Only set Hikari dataSourceClassName or driverClassName but not both

Conflicts:
	slick/src/main/scala/slick/jdbc/JdbcDataSource.scala
  • Loading branch information...
jkutner authored and szeiger committed Aug 18, 2015
1 parent f109739 commit 8ac4298758b0d7d4c6fcc814f83dee3436e37172
Showing with 5 additions and 2 deletions.
  1. +5 −2 slick-hikaricp/src/main/scala/slick/jdbc/hikaricp/HikariCPJdbcDataSource.scala
@@ -22,8 +22,11 @@ object HikariCPJdbcDataSource extends JdbcDataSourceFactory {
val hconf = new HikariConfig()
// Connection settings
hconf.setDataSourceClassName(c.getStringOr("dataSourceClass", null))
Option(c.getStringOr("driverClassName", c.getStringOr("driver"))).map(hconf.setDriverClassName _)
if (c.hasPath("dataSourceClass")) {
hconf.setDataSourceClassName(c.getString("dataSourceClass"))
} else {
Option(c.getStringOr("driverClassName", c.getStringOr("driver"))).map(hconf.setDriverClassName _)
}
hconf.setJdbcUrl(c.getStringOr("url", null))
c.getStringOpt("user").foreach(hconf.setUsername)
c.getStringOpt("password").foreach(hconf.setPassword)

0 comments on commit 8ac4298

Please sign in to comment.