Skip to content

Commit

Permalink
Merge branch 'master' into github
Browse files Browse the repository at this point in the history
  • Loading branch information
zouzg committed Dec 2, 2018
2 parents f04b2b9 + 9cbd43e commit 7b6da29
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 17 deletions.
17 changes: 2 additions & 15 deletions src/main/java/com/zzg/mybatis/generator/MainUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* 这是本软件的主入口,要运行本软件请直接运行本类就可以了,不用传入任何参数
* 本软件要求jkd版本大于1.8.0.40
*/
public class MainUI extends Application {

Expand All @@ -35,21 +36,7 @@ public void start(Stage primaryStage) throws Exception {
}

public static void main(String[] args) {
String version = System.getProperty("java.version");
if (Integer.parseInt(version.substring(0,1)) == 1 && Integer.parseInt(version.substring(2, 3)) >= 8 && Integer.parseInt(version.substring(6)) >= 60 || Integer.parseInt(version.substring(0,1))>=9) {
launch(args);
}else {
JFrame jFrame = new JFrame("版本错误");
jFrame.setSize(500, 100);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jPanel = new JPanel();
JLabel jLabel = new JLabel("JDK的版本不能低于1.8.0.60,请升级至最近的JDK 1.8再运行此软件,当前版本:" + version);
jPanel.add(jLabel);
jFrame.add(jPanel);
jFrame.setLocationRelativeTo(null);
jFrame.setVisible(true);

}
launch(args);
}

}
2 changes: 1 addition & 1 deletion src/main/java/com/zzg/mybatis/generator/model/DbType.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public enum DbType {

MySQL("com.mysql.jdbc.Driver", "jdbc:mysql://%s:%s/%s?useUnicode=true&useSSL=false&characterEncoding=%s", "mysql-connector-java-5.1.38.jar"),
MySQL_8("com.mysql.cj.jdbc.Driver", "jdbc:mysql://%s:%s/%s?serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=%s", "mysql-connector-java-8.0.11.jar"),
Oracle("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@%s:%s:%s", "ojdbc14.jar"),
Oracle("oracle.jdbc.OracleDriver", "jdbc:oracle:thin:@//%s:%s/%s", "ojdbc6.jar"),
PostgreSQL("org.postgresql.Driver", "jdbc:postgresql://%s:%s/%s", "postgresql-9.4.1209.jar"),
SQL_Server("com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://%s:%s;databaseName=%s", "sqljdbc4-4.0.jar"),
Sqlite("org.sqlite.JDBC", "jdbc:sqlite:%s", "sqlite-jdbc-3.19.3.jar");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/zzg/mybatis/generator/util/DbUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static List<UITableColumnVO> getTableColumns(DatabaseConfig dbConfig, Str
Connection conn = getConnection(dbConfig);
try {
DatabaseMetaData md = conn.getMetaData();
ResultSet rs = md.getColumns(null, null, tableName, null);
ResultSet rs = md.getColumns(dbConfig.getSchema(), null, tableName, null);
List<UITableColumnVO> columns = new ArrayList<>();
while (rs.next()) {
UITableColumnVO columnVO = new UITableColumnVO();
Expand Down
Binary file removed src/main/resources/lib/ojdbc14.jar
Binary file not shown.
Binary file added src/main/resources/lib/ojdbc6.jar
Binary file not shown.

0 comments on commit 7b6da29

Please sign in to comment.