This example assumes you have previously completed the following examples:
- Create an Azure Resource Group
- Create an Azure Database for MySQL
- Install curl
- Open MySQL server firewall to your IP address
- Install mysql client
- Load your MySQL database with your data
This example will get country information from the database.
First lets build the example.
mvn package
The command line below will get the country information for the country with the abbreviation 'USA'.
java -jar target/get-country.jar jdbc:mysql://$MYSQL_DNS_NAME:3306/demo?useSSL=true\&requireSSL=true $MYSQL_CLIENT_USERNAME $MYSQL_PASSWORD USA
Note the & has been escaped using the backslash as this is needed when passing it into the shell. Omit the backslash when using it in your configuration files.
Do NOT forget to remove the resources once you are done running the example.