【问题标题】:how use hibernate grails 3,mysql?如何使用hibernate grails 3,mysql?
【发布时间】:2017-07-28 00:19:14
【问题描述】:

我有 MySQL 服务器和 2 个应用程序:网站 (grails3) 和 android 应用程序。该数据库包含比赛时间表。 android 应用程序向 Web 服务器(不是 MySQL 服务器)发送请求。如果时间表已更新,则您必须将其显示在手机上。如何为此使用hibernate和grails3?

【问题讨论】:

标签: java mysql hibernate grails groovy


【解决方案1】:

好的,正如我从 cmets 中的对话中了解到的,您在 Hibernate 配置的某些方面遇到了问题。

文档的第 4 节给出了答案:http://gorm.grails.org/6.0.x/hibernate/manual/#configuration

grails-app/conf/application.yml 文件负责各种设置。

这是我的培训项目中的示例:https://github.com/ahlinist/tempvs/blob/master/grails-app/conf/application.yml

注意dataSource 属性,login 和 pass 都在那里配置。可以为使用给定数据源的每种环境类型单独配置 URL(带有数据库名称)。

【讨论】:

  • 如何在intellij的项目中添加mysql连接器? java.sql.SQLException:无法从 ClassLoader 加载类:com.mysql.jdbc.Driver:sun.misc.Launcher$AppClassLoader@18b4aac2;ClassLoader:TomcatEmbeddedWebappClassLoader
  • 查看 build.gradle:github.com/ahlinist/tempvs/blob/master/build.gradle。有一行:runtime 'mysql:mysql-connector-java:5.1.39'
  • 请帮我这个 qwestion stackoverflow.com/questions/43055167/… 。本期续本
  • @SanychGoilo,你没有接受这个答案。没有帮助吗?
猜你喜欢
  • 1970-01-01
  • 2011-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多