This commit is contained in:
Naoki Takezoe
2016-04-15 13:26:27 +09:00
parent eba240de65
commit 85b2053004

View File

@@ -46,11 +46,11 @@ sealed trait DatabaseType {
object DatabaseType {
def apply(url: String): DatabaseType = {
if(url.indexOf("h2") >= 0){
if(url.startsWith("jdbc:h2:")){
H2
} else if(url.indexOf("mysql") >= 0){
} else if(url.startsWith("jdbc:mysql:")){
MySQL
} else if(url.indexOf("postgresql") >= 0){
} else if(url.startsWith("jdbc:postgresql:")){
PostgreSQL
} else {
throw new IllegalArgumentException(s"${url} is not supported.")