我正在尝试使用Play从mysql服务器获取数据!我的方法是这样的:
/application.confdb.default.driver=com.mysql.jdbc.Driver db.default.url="jdbc:mysql://localhost:3306/CED?characterEncoding=UTF-8“db.default.user=中,根”db.default.password=“根”ebean.default=“模型。/models/Budget.java包模型;//imports @Entity公共类预算扩展了Model { @Id公共字符串id;@Constraints.Required公共字符串hauptkategorie;公共静态Model.Finder find =新Model.Finder(String.class,Budget.class);公共静态Map options() { LinkedHashMap options = new LinkedHashMap();for(预算c: Budget.find.orderBy("id").findList()) { options.put(c.id,.findList);}System.out.println(选项);返回选项;}
我在CED数据库中有一个名为预算的表,其中有2列id,hauptkategorie。当我运行服务器时,我会得到这个错误Database 'default' needs evolution!,并尝试应用创建表的script。但是,我想要预算的是从我的DB中获取数据。配置问题或缺少的部件在哪里?
发布于 2013-02-28 21:21:16
必须在application.conf中取消此属性的注释。
# Evolutions
# ~~~~~
# You can disable evolutions if needed
evolutionplugin=disabledhttps://stackoverflow.com/questions/15139401
复制相似问题