Skip to content

Jegadeeshkannan/spring-boot-liquibase-docker

Repository files navigation

Save and fetch Suburban Details to/from MySQL DB

This application used to save the Suburban details to MySQL DB and find the ranges of postcodes suburban names and combine all names total length from the result of given ranges of postal codes.

Save the Suburban Details to MYSQL DB

  1. Save the suburban details Please use this below url and refer below the sample data and the ID should be unique as this is primary hkey and it is autogenerated id.

localhost:8080/v1/suburb/suburbDetail

image

[ {
        "suburbName": "DAGGAR HILLS,WA",
        "postcode": 6638
    },
    {
        "suburbName": "LAKE POWELL,VIC",
        "postcode": 3597
    }

]

Fetch the Suburban Details from MYSQL DB for given two post code ranges and find length of combination of suburban names for the given range of post code results

  1. Fetch the data for the given ranges of two post codes and it should be sorted alphabetically and find the total length of the combinationa of all the urban names of the given post code ranges result data.

localhost:8080/v1/suburb/suburblist/4805/4860

image

{ "sortedListBySuburbNames": [ { "suburbId": 15, "suburbName": "O'BRIENS HILL,QLD", "postcode": 4860 }, { "suburbId": 13, "suburbName": "QUEENS BEACH,QLD", "postcode": 4805 } ], "combinedSuburbNameLength": 33 }

MYSQL workbench client to Connect MySQL that is hosted in Docker.

Please set the following grant permission using these below commands

List all containers and navigate to bin/bash of the MySQL container:

docker ps

docker exec -it /bin/bash

Login as root user

mysql -u root -p

The percent sign (%) means all ip's. Restart the docker container.

grant all privileges on . to 'jegadeesh'@'%' with grant option;

flush privileges;

image

image

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors