master
潘啟华 6 years ago
parent 3b192347fb
commit 259d903b53
  1. 1
      hibernate/pom.xml
  2. 9
      hibernate/src/main/java/config/DBType.java
  3. 9
      mybatis/src/main/java/config/DBType.java

@ -20,6 +20,7 @@
<commons-lang3.version>3.8.1</commons-lang3.version>
<commons-io.version>2.6</commons-io.version>
<mysql.version>8.0.15</mysql.version>
<!-- <mysql.version>5.1.47</mysql.version>-->
<fastjson.version>1.2.56</fastjson.version>
</properties>

@ -5,9 +5,9 @@ import org.hibernate.dialect.*;
import java.sql.Driver;
public enum DBType {
mysql5(com.mysql.jdbc.Driver.class, MySQL5Dialect.class),
mysql55(com.mysql.jdbc.Driver.class, MySQL55Dialect.class),
mysql57(com.mysql.jdbc.Driver.class, MySQL57Dialect.class),
mysql5(com.mysql.cj.jdbc.Driver.class, MySQL5Dialect.class),
mysql55(com.mysql.cj.jdbc.Driver.class, MySQL55Dialect.class),
mysql57(com.mysql.cj.jdbc.Driver.class, MySQL57Dialect.class),
mysql8(com.mysql.cj.jdbc.Driver.class, MySQL8Dialect.class);
private Class<? extends Driver> driver;
@ -33,7 +33,8 @@ public enum DBType{
case mysql57:
case mysql8:
return "jdbc:mysql://" + host + ":" + port + "/" + name + "?serverTimezone=GMT%2b8";
default:throw new RuntimeException("NotFound type:"+this.name());
default:
throw new RuntimeException("NotFound type:" + this.name());
}
}

@ -4,9 +4,9 @@ package config;
import java.sql.Driver;
public enum DBType {
mysql5(com.mysql.jdbc.Driver.class),
mysql55(com.mysql.jdbc.Driver.class),
mysql57(com.mysql.jdbc.Driver.class),
mysql5(com.mysql.cj.jdbc.Driver.class),
mysql55(com.mysql.cj.jdbc.Driver.class),
mysql57(com.mysql.cj.jdbc.Driver.class),
mysql8(com.mysql.cj.jdbc.Driver.class);
private Class<? extends Driver> driver;
@ -26,7 +26,8 @@ public enum DBType {
case mysql57:
case mysql8:
return "jdbc:mysql://" + host + ":" + port + "/" + name + "?serverTimezone=GMT%2b8";
default:throw new RuntimeException("NotFound type:"+this.name());
default:
throw new RuntimeException("NotFound type:" + this.name());
}
}
}

Loading…
Cancel
Save