An tutorial application using Spring Boot as REST API with JOOQ back-end.
More details about the codes, please read the online Spring Boot.
Running in
- JDK 1.8 or newer
- Spring Boot 1.5.2.RELEASE or newer
- jOOQ 3.9.2 or newer
- Gradle 3.4.1 or newer
- Lombok
- H2
- YAML
- Logback
- org.springframework.boot:spring-boot-starter-jooq
- org.springframework.boot:spring-boot-starter-security
- org.jooq:jooq-codegen:3.9.2
- org.springframework.boot:spring-boot-devtools
- com.h2database:h2
- 1.0 (Apr 20, 2017)
- Clone this Git repository
- Generate Java code from your database
$ ./gradle clean build
- Build the project gradle build
- Run the application ./gradlew bootRun
$ ./gradle bootRun
schema file schema.sql
- connect database
http://localhost:8080/h2-console
gradle file build.gradle
- target packages
def xml = new groovy.xml.MarkupBuilder(writer).configuration('xmlns': 'http://www.jooq.org/xsd/jooq-codegen-3.9.2.xsd') {
...
generator() {
...
target() {
packageName('com.warumono.databases') // <----- base package path
directory('src/main/java') // <----- target directory path
}
}
}
By default Spring Boot applications run on port 9090. But may vary depending on what ports are in use on your machine (check the terminal after entering the ./gradlew bootRun command). If you require to change which port the application runs on by default, add the following to:
server:
port: 8080 # --> change other port via. 9090
warumono - warumono.for.develop@gmail.com
spring-boot-jooq-tutorial is available under the Apache license. See the LICENSE file for more info.