开发者

How to configure Grails to work with Apache Derby?

开发者 https://www.devze.com 2022-12-13 14:32 出处:网络
How to configure G开发者_StackOverflow社区rails to work with Apache Derby instead of HSQLDB Install the derby driver into the lib folder of your application.

How to configure G开发者_StackOverflow社区rails to work with Apache Derby instead of HSQLDB


  1. Install the derby driver into the lib folder of your application.
  2. Configure the DataSource:

    driverClassName = "org.apache.derby.jdbc.ClientDriver"
    dbCreate = "create-drop"
    url = "jdbc:derby://localhost:1527/theDatabase"

  3. Start the derby server.

  4. Create the empty database (through ij or a graphical sql client).
  5. Start grails.


You need to have Derby libraries, and configure your DataSources.groovy appropriately. Check out this blog post. It's old, but the instructions might still work.


Configuration for grails 3 in application.yml

        dataSource:
            dbCreate: create-drop
            driverClassName: org.apache.derby.jdbc.EmbeddedDriver
            url: jdbc:derby:memory:db;create=true

And build.gradle

dependencies {
   runtime 'org.apache.derby:derby:10.12.1.1'
   //... other dependencies
}
0

精彩评论

暂无评论...
验证码 换一张
取 消