GithubHelp home page GithubHelp logo

isabella232 / quickstart-spring-data-jdbc-mysql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/quickstart-spring-data-jdbc-mysql

0.0 0.0 0.0 75 KB

Sample application for https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-data-jdbc-with-azure-mysql/

License: MIT License

Shell 40.98% Java 55.76% TSQL 3.26%

quickstart-spring-data-jdbc-mysql's Introduction

Sample project for Spring Data JDBC with Azure Database for MySQL

This sample project is used in the Use Spring Data JDBC with Azure Database for MySQL Microsoft documentation quickstart.

Creating the infrastructure

We recommend you create an env.sh file to create the following environment variables:

#!/bin/sh

echo "Setting env variables"

export AZ_RESOURCE_GROUP=tmp-spring-jdbc-mysql
export AZ_DATABASE_NAME=XXXXXX-tmp-spring-jdbc-mysql
export AZ_LOCATION=eastus
export AZ_MYSQL_USERNAME=spring
export AZ_MYSQL_PASSWORD=XXXXXXXXXXXXXXXXXXX
export AZ_LOCAL_IP_ADDRESS=$(curl http://whatismyip.akamai.com/)

export SPRING_DATASOURCE_URL=jdbc:mysql://$AZ_DATABASE_NAME.mysql.database.azure.com:3306/demo?serverTimezone=UTC
export SPRING_DATASOURCE_USERNAME=spring@$AZ_DATABASE_NAME
export SPRING_DATASOURCE_PASSWORD=$AZ_MYSQL_PASSWORD

You will need to set up a unique AZ_DATABASE_NAME as well as a correctly secured AZ_MYSQL_PASSWORD.

Once this file is created:

  • Use source env.sh to set up those environment variables
  • Use ./create-spring-data-jdbc-mysql.sh to create your infrastructure
  • Use ./destroy-spring-data-jdbc-mysql.sh to delete your infrastructure

Running the project

This is a standard Maven project, you can run it from your IDE, or using the provided Maven wrapper:

./mvnw spring-boot:run

quickstart-spring-data-jdbc-mysql's People

Contributors

jdubois avatar microsoft-github-operations[bot] avatar microsoftopensource avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.