-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDrivers.scala
43 lines (30 loc) · 1002 Bytes
/
Drivers.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.komanov.mysql.streaming
import com.komanov.mysql.streaming.Drivers._
object Drivers {
val Host = "localhost"
val Port = 3316
val UserName = "sa"
val Password = "sa"
val DataBase = "streaming_test"
val list = Seq(
ConnectorJDriver,
MariaDbDriver,
DrizzleDriver
)
}
sealed trait MysqlDriver {
def name: String
def url: String
}
case object ConnectorJDriver extends MysqlDriver {
override val name = "ConnectorJ"
override val url = s"jdbc:mysql://$Host:$Port/$DataBase?user=$UserName&password=$Password&cacheServerConfiguration=true&createDatabaseIfNotExist=false"
}
case object MariaDbDriver extends MysqlDriver {
override val name = "MariaDB"
override val url = s"jdbc:mariadb://$Host:$Port/$DataBase?user=$UserName&password=$Password&fastConnect=true&tcpAbortiveClose=true"
}
case object DrizzleDriver extends MysqlDriver {
override val name = "Drizzle"
override val url = s"jdbc:drizzle://$UserName:$Password@$Host:$Port/$DataBase"
}