================
This project is a sample data manager. It provides a basic template for Java/Spring developers. This project also includes form validation of controller model objects and request parameters. Users can view, add, delete person objects from the database via web UI.
Java 21 (LTS Version), Spring Boot 3, Hibernate, MySQL or H2 databases supported, JSP, Gradle 8.10
MySql
docker pull mysql:latest
docker run -d --name test-mysql -e MYSQL_ROOT_PASSWORD=mypassword -p 3307:3306 mysql
docker logs test-mysql
docker exec -it test-mysql bash
docker network create my-network
docker inspect network my-network
docker network connect my-network <mysql_container_name:test-mysql>
Inspect network configurations & update application properties with IPv4Address instead of localhost if mac user (IPv4Address for my-sql etc.)
- Get IPv4Address from inspect cmd and test connection from MySql workbench with new host IP. Run StarterDb.sql.
docker inspect network my-network
gradle clean build
Run 'com.ironoc.db.App.java' directly from IntelliJ (can use localhost for spring.datasource.url) or via CLI (build & spin up docker image, use docker network IP address for test-mysql process):
docker image build -t ironoc-db .
docker compose up -d
docker logs ironoc-db-web-1 -f
gradle bootRun --args='--spring.profiles.active=h2'
gradle bootRun --args='--spring.profiles.active=default'
docker stop test-mysql
docker remove test-mysql