Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added configuration using properties.

  • Loading branch information...
commit e8c474fa4c904b2f5a53af15d3a984512ed6b70b 1 parent 4a6d984
Erik Rozendaal authored
4 example/src/main/resources/props/default.props
... ... @@ -0,0 +1,4 @@
  1 +jdbc.url=jdbc:mysql://localhost:3306/es2_dev
  2 +jdbc.driver=com.mysql.jdbc.Driver
  3 +jdbc.user=root
  4 +jdbc.password=
3  example/src/main/resources/props/production.default.props
... ... @@ -0,0 +1,3 @@
  1 +jdbc.url=jdbc:mysql://localhost:3306/es2
  2 +jdbc.user=root
  3 +jdbc.password=
12 example/src/main/scala/example/app/Application.scala
@@ -43,17 +43,19 @@ object Application {
43 43 result
44 44 }
45 45
46   - val jdbcUrl = "jdbc:mysql://localhost:3306/es2"
47   - val jdbcDriver = "com.mysql.jdbc.Driver"
  46 + val jdbcUrl = Props.get("jdbc.url", "jdbc:mysql://localhost:3306/es2_dev")
  47 + val jdbcDriver = Props.get("jdbc.driver", "com.mysql.jdbc.Driver")
  48 + val jdbcUser = Props.get("jdbc.user", "root")
  49 + val jdbcPassword = Props.get("jdbc.password", "")
48 50
49 51 Class.forName(jdbcDriver)
50 52
51 53 val c3p0 = new ComboPooledDataSource
52 54 c3p0.setDriverClass(jdbcDriver)
53 55 c3p0.setJdbcUrl(jdbcUrl)
54   - c3p0.setUser("root")
55   - c3p0.setPassword("")
56   - c3p0.setInitialPoolSize(100)
  56 + c3p0.setUser(jdbcUser)
  57 + c3p0.setPassword(jdbcPassword)
  58 + c3p0.setInitialPoolSize(1)
57 59 c3p0.setMaxPoolSize(100)
58 60
59 61 SessionFactory.concreteFactory = Some {
2  project/build.properties
@@ -2,7 +2,7 @@
2 2 #Thu Feb 10 20:56:36 CET 2011
3 3 project.organization=com.zilverline
4 4 project.name=es2
5   -sbt.version=0.7.5.RC0
  5 +sbt.version=0.7.5.RC1
6 6 project.version=0.1-SNAPSHOT
7 7 build.scala.versions=2.8.1
8 8 project.initialize=false
2  project/plugins/project/build.properties
... ... @@ -1,3 +1,3 @@
1 1 #Project properties
2   -#Fri Mar 18 21:42:56 CET 2011
  2 +#Fri Mar 25 19:46:09 CET 2011
3 3 plugin.uptodate=true

0 comments on commit e8c474f

Please sign in to comment.
Something went wrong with that request. Please try again.