Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bbb361
commit fe7a710
Showing
6 changed files
with
33 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.example | ||
|
||
import scala.slick.driver.PostgresDriver.simple._ | ||
import com.mchange.v2.c3p0.ComboPooledDataSource | ||
|
||
trait DatabaseAccess { | ||
val Url = "jdbc:postgresql://localhost:5432/demo" | ||
val Driver = "org.postgresql.Driver" | ||
|
||
val database = Database.forURL(Url, driver = Driver) | ||
|
||
val databasePool = { | ||
val ds = new ComboPooledDataSource | ||
ds.setDriverClass(Driver) | ||
ds.setJdbcUrl(Url) | ||
ds.setMinPoolSize(20) | ||
ds.setAcquireIncrement(5) | ||
ds.setMaxPoolSize(100) | ||
Database.forDataSource(ds) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters