diff --git a/src/main/java/com/zzg/mybatis/generator/MainUI.java b/src/main/java/com/zzg/mybatis/generator/MainUI.java index 19ac9f1b..bbe43401 100644 --- a/src/main/java/com/zzg/mybatis/generator/MainUI.java +++ b/src/main/java/com/zzg/mybatis/generator/MainUI.java @@ -15,6 +15,7 @@ /** * 这是本软件的主入口,要运行本软件请直接运行本类就可以了,不用传入任何参数 + * 本软件要求jkd版本大于1.8.0.40 */ public class MainUI extends Application { @@ -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); } } diff --git a/src/main/java/com/zzg/mybatis/generator/model/DbType.java b/src/main/java/com/zzg/mybatis/generator/model/DbType.java index c10adbdb..ef21132a 100644 --- a/src/main/java/com/zzg/mybatis/generator/model/DbType.java +++ b/src/main/java/com/zzg/mybatis/generator/model/DbType.java @@ -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"); diff --git a/src/main/java/com/zzg/mybatis/generator/util/DbUtil.java b/src/main/java/com/zzg/mybatis/generator/util/DbUtil.java index 15f90c7c..8f92005c 100644 --- a/src/main/java/com/zzg/mybatis/generator/util/DbUtil.java +++ b/src/main/java/com/zzg/mybatis/generator/util/DbUtil.java @@ -83,7 +83,7 @@ public static List 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 columns = new ArrayList<>(); while (rs.next()) { UITableColumnVO columnVO = new UITableColumnVO(); diff --git a/src/main/resources/lib/ojdbc14.jar b/src/main/resources/lib/ojdbc14.jar deleted file mode 100644 index cca9b8bb..00000000 Binary files a/src/main/resources/lib/ojdbc14.jar and /dev/null differ diff --git a/src/main/resources/lib/ojdbc6.jar b/src/main/resources/lib/ojdbc6.jar new file mode 100644 index 00000000..767eba7f Binary files /dev/null and b/src/main/resources/lib/ojdbc6.jar differ