To test the app and connect to database,you need to entry username and password in application.properties file to access your poseidon database created and stored in mysql, complete lines in src/main/resources/application.properties as follow:
spring.datasource.url=jdbc:mysql://localhost:3306/poseidon?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=myUserName <-- your mysql user name with privileges to access poseidon database
spring.datasource.password=myPassword <-- your mysql user password
- Framework: Spring Boot v2.0.4
- Java 8
- Thymeleaf
- Bootstrap v.4.3.1
- Create project from Initializr: File > New > project > Spring Initializr
- Add lib repository into pom.xml
- Add folders
- Source root: src/main/java
- View: src/main/resources
- Static: src/main/resource/static
- Create database with name "demo" as configuration in application.properties
- Run sql script to create table doc/data.sql
- Create mapping domain class and place in package com.nnk.springboot.domain
- Create repository class and place in package com.nnk.springboot.repositories
- Create controller class and place in package com.nnk.springboot.controllers
- Create view files and place in src/main/resource/templates
- Create unit test and place in package com.nnk.springboot in folder test > java
- Create user service to load user from database and place in package com.nnk.springboot.services
- Add configuration class and place in package com.nnk.springboot.config