graemerocher / oracle-jsonview-demo-app

Demo app using Micronaut and Oracle Json View

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is an example application for Micronaut Data using an Oracle JSON Duality View.

It uses a test container with the container image "gvenzl/oracle-free:latest-faststart" by default and then the datasource configuration is taken from the container before starting Micronaut application context.

Note: To run the application you need a Docker-API compatible container runtime such as Docker, Podman, or Rancher Desktop installed and running.

To get started, run the application as follows:

./gradlew run

Wait until the application has started and created the database schema.

Test the application by using curl to call the API.

  1. List all the students and their schedules:

    curl http://localhost:8080/students
  2. Retrieve a schedule by student name:

    curl http://localhost:8080/students/student/Jill
  3. Retrieve a schedule by student id:

    curl http://localhost:8080/students/3
  4. Create a new student with courses (and view that student's schedule):

    curl -d '{"student":"Sandro", "averageGrade":8.9, "courses": ["Math", "English"]}' \
    -H "Content-Type: application/json" \
    -X POST http://localhost:8080/students
  5. Update a student's average grade (by student id):

    curl -X PUT http://localhost:8080/students/1/average_grade/9.8
  6. Retrieve the maximum average grade:

    curl http://localhost:8080/students/max_average_grade
  7. Update a student's name (by student id), for example, to correct a typo:

    curl -X PUT http://localhost:8080/students/1/student/Dennis
  8. Delete a student by student id and retrieve the new maximum average grade (to confirm deletion):

    curl -X DELETE http://localhost:8080/students/1
    curl http://localhost:8080/students/max_average_grade

About

Demo app using Micronaut and Oracle Json View


Languages

Language:Java 100.0%