关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 3034|回复: 4

基于MS SQL Server数据库,使用代码生成器,报错,如何解决

[复制链接]
发表于 2019-7-24 20:45:47 | 显示全部楼层 |阅读模式
Jeecg-boot 2.0.2

问题:请问版主,基于MS SQL Server数据库,使用代码生成器,报错,如何解决



代码生成器

代码生成器
2.png

数据库连接配置

数据库连接配置
发表于 2019-7-25 10:10:50 | 显示全部楼层
你是老版jeecg吧
 楼主| 发表于 2019-7-31 10:11:22 | 显示全部楼层
是最近下载的,版本如下
<groupId>org.jeecgframework.boot</groupId>
  <artifactId>jeecg-boot-parent</artifactId>
  <version>2.0.2</version>
  <packaging>pom</packaging>
  
          <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.1.3.RELEASE</version>
            <relativePath/>
        </parent>
发表于 2019-7-31 13:44:13 | 显示全部楼层
 楼主| 发表于 2019-8-1 17:02:57 | 显示全部楼层
感谢版主耐心解答,但是我按文档修改配置,连MS SQL Server还是不成功。连接MySQL数据库没问题。
1.错误代码
  1. 16:52:47.924 [AWT-EventQueue-0] DEBUG org.jeecgframework.codegenerate.database.DbReadTableUtil - 数据库驱动: org.hibernate.dialect.SQLServerDialect
  2. java.lang.ClassNotFoundException: org.hibernate.dialect.SQLServerDialect
  3.         at java.net.URLClassLoader.findClass(Unknown Source)
  4.         at java.lang.ClassLoader.loadClass(Unknown Source)
  5.         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  6.         at java.lang.ClassLoader.loadClass(Unknown Source)
  7.         at java.lang.Class.forName0(Native Method)
  8.         at java.lang.Class.forName(Unknown Source)
  9.         at org.jeecgframework.codegenerate.database.DbReadTableUtil.c(DbReadTableUtil.java:390)
  10.         at org.jeecgframework.codegenerate.window.CodeWindow$1.actionPerformed(CodeWindow.java:178)
  11.         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  12.         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  13.         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  14.         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  15.         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  16.         at java.awt.Component.processMouseEvent(Unknown Source)
  17.         at javax.swing.JComponent.processMouseEvent(Unknown Source)
  18.         at java.awt.Component.processEvent(Unknown Source)
  19.         at java.awt.Container.processEvent(Unknown Source)
  20.         at java.awt.Component.dispatchEventImpl(Unknown Source)
  21.         at java.awt.Container.dispatchEventImpl(Unknown Source)
  22.         at java.awt.Component.dispatchEvent(Unknown Source)
  23.         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  24.         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  25.         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  26.         at java.awt.Container.dispatchEventImpl(Unknown Source)
  27.         at java.awt.Window.dispatchEventImpl(Unknown Source)
  28.         at java.awt.Component.dispatchEvent(Unknown Source)
  29.         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  30.         at java.awt.EventQueue.access$500(Unknown Source)
  31.         at java.awt.EventQueue$3.run(Unknown Source)
  32.         at java.awt.EventQueue$3.run(Unknown Source)
  33.         at java.security.AccessController.doPrivileged(Native Method)
  34.         at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  35.         at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  36.         at java.awt.EventQueue$4.run(Unknown Source)
  37.         at java.awt.EventQueue$4.run(Unknown Source)
  38.         at java.security.AccessController.doPrivileged(Native Method)
  39.         at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  40.         at java.awt.EventQueue.dispatchEvent(Unknown Source)
  41.         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  42.         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  43.         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  44.         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  45.         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  46.         at java.awt.EventDispatchThread.run(Unknown Source)
  47. ERROR :   表 [ demo ] 在数据库中,不存在 !请确认数据源配置是否配置正确、表名是否填写正确~
复制代码
2. jeecg_database.properties文件配置
  1. 16:52:47.924 [AWT-EventQueue-0] DEBUG org.jeecgframework.codegenerate.database.DbReadTableUtil - 数据库驱动: org.hibernate.dialect.SQLServerDialect
  2. java.lang.ClassNotFoundException: org.hibernate.dialect.SQLServerDialect
  3.         at java.net.URLClassLoader.findClass(Unknown Source)
  4.         at java.lang.ClassLoader.loadClass(Unknown Source)
  5.         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  6.         at java.lang.ClassLoader.loadClass(Unknown Source)
  7.         at java.lang.Class.forName0(Native Method)
  8.         at java.lang.Class.forName(Unknown Source)
  9.         at org.jeecgframework.codegenerate.database.DbReadTableUtil.c(DbReadTableUtil.java:390)
  10.         at org.jeecgframework.codegenerate.window.CodeWindow$1.actionPerformed(CodeWindow.java:178)
  11.         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  12.         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  13.         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  14.         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  15.         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  16.         at java.awt.Component.processMouseEvent(Unknown Source)
  17.         at javax.swing.JComponent.processMouseEvent(Unknown Source)
  18.         at java.awt.Component.processEvent(Unknown Source)
  19.         at java.awt.Container.processEvent(Unknown Source)
  20.         at java.awt.Component.dispatchEventImpl(Unknown Source)
  21.         at java.awt.Container.dispatchEventImpl(Unknown Source)
  22.         at java.awt.Component.dispatchEvent(Unknown Source)
  23.         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  24.         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  25.         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  26.         at java.awt.Container.dispatchEventImpl(Unknown Source)
  27.         at java.awt.Window.dispatchEventImpl(Unknown Source)
  28.         at java.awt.Component.dispatchEvent(Unknown Source)
  29.         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  30.         at java.awt.EventQueue.access$500(Unknown Source)
  31.         at java.awt.EventQueue$3.run(Unknown Source)
  32.         at java.awt.EventQueue$3.run(Unknown Source)
  33.         at java.security.AccessController.doPrivileged(Native Method)
  34.         at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  35.         at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  36.         at java.awt.EventQueue$4.run(Unknown Source)
  37.         at java.awt.EventQueue$4.run(Unknown Source)
  38.         at java.security.AccessController.doPrivileged(Native Method)
  39.         at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
  40.         at java.awt.EventQueue.dispatchEvent(Unknown Source)
  41.         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  42.         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  43.         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  44.         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  45.         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  46.         at java.awt.EventDispatchThread.run(Unknown Source)
  47. ERROR :   表 [ demo ] 在数据库中,不存在 !请确认数据源配置是否配置正确、表名是否填写正确~
复制代码
3.jeecg_config.properties文件配置
  1. #code_generate_project_path
  2. project_path=E:\\eclipse2018-workspace\\jeecg-boot
  3. #bussi_package[User defined]
  4. bussi_package=org.jeecg.modules.tran


  5. #default code path
  6. #source_root_package=src
  7. #webroot_package=WebRoot

  8. #maven code path
  9. source_root_package=src.main.java
  10. webroot_package=src.main.webapp

  11. #ftl resource url
  12. templatepath=/jeecg/code-template
  13. system_encoding=utf-8

  14. #db Table id [User defined]
  15. db_table_id=id

  16. #db convert flag[true/false]
  17. db_filed_convert=true

  18. #page Search Field num [User defined]
  19. page_search_filed_num=1
  20. #page_filter_fields
  21. page_filter_fields=create_time,create_by,update_time,update_by


复制代码

数据库连接相关

数据库连接相关

代码生成错误

代码生成错误
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表