Skip to content

Latest commit

 

History

History
78 lines (48 loc) · 2.13 KB

File metadata and controls

78 lines (48 loc) · 2.13 KB

JDBC command line client

mysql/get-country/README.md

Prerequisites

This example assumes you have previously completed the following examples:

  1. Create an Azure Resource Group
  2. Create an Azure Database for MySQL
  3. Install curl
  4. Open MySQL server firewall to your IP address
  5. Install mysql client
  6. Load your MySQL database with your data

JDBC command line client

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.

Cleanup

Do NOT forget to remove the resources once you are done running the example.