How to configure Grails to work with Apache Derby?
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.
Configure the DataSource:
driverClassName = "org.apache.derby.jdbc.ClientDriver"
dbCreate = "create-drop"
url = "jdbc:derby://localhost:1527/theDatabase"Start the derby server.
- Create the empty database (through ij or a graphical sql client).
- 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
}
精彩评论