Skip to content

Commit 8ff543a

Browse files
authored
rename application.properties to database.properties
1 parent b08ae34 commit 8ff543a

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

articles/mysql/flexible-server/connect-java.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,14 @@ This file is an [Apache Maven](https://maven.apache.org/) file that configures y
353353

354354
### Prepare a configuration file to connect to Azure Database for MySQL
355355

356-
Run the following script in the project root directory to create a *src/main/resources/application.properties* file and add configuration details:
356+
Run the following script in the project root directory to create a *src/main/resources/database.properties* file and add configuration details:
357357

358358
#### [Passwordless connection (Recommended)](#tab/passwordless)
359359

360360
```bash
361-
mkdir -p src/main/resources && touch src/main/resources/application.properties
361+
mkdir -p src/main/resources && touch src/main/resources/database.properties
362362

363-
cat << EOF > src/main/resources/application.properties
363+
cat << EOF > src/main/resources/database.properties
364364
url=jdbc:mysql://${AZ_DATABASE_NAME}.mysql.database.azure.com:3306/demo?sslMode=REQUIRED&serverTimezone=UTC&defaultAuthenticationPlugin=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin&authenticationPlugins=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin
365365
user=${AZ_MYSQL_AD_NON_ADMIN_USERNAME}
366366
EOF
@@ -370,9 +370,9 @@ EOF
370370
> If you are using MysqlConnectionPoolDataSource class as the datasource in your application, please remove "defaultAuthenticationPlugin=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin" in the url.
371371
372372
```bash
373-
mkdir -p src/main/resources && touch src/main/resources/application.properties
373+
mkdir -p src/main/resources && touch src/main/resources/database.properties
374374

375-
cat << EOF > src/main/resources/application.properties
375+
cat << EOF > src/main/resources/database.properties
376376
url=jdbc:mysql://${AZ_DATABASE_NAME}.mysql.database.azure.com:3306/demo?sslMode=REQUIRED&serverTimezone=UTC&authenticationPlugins=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin
377377
user=${AZ_MYSQL_AD_NON_ADMIN_USERNAME}
378378
EOF
@@ -381,9 +381,9 @@ EOF
381381
#### [Password](#tab/password)
382382

383383
```bash
384-
mkdir -p src/main/resources && touch src/main/resources/application.properties
384+
mkdir -p src/main/resources && touch src/main/resources/database.properties
385385

386-
cat << EOF > src/main/resources/application.properties
386+
cat << EOF > src/main/resources/database.properties
387387
url=jdbc:mysql://${AZ_DATABASE_NAME}.mysql.database.azure.com:3306/demo?useSSL=true&sslMode=REQUIRED&serverTimezone=UTC
388388
user=${AZ_MYSQL_NON_ADMIN_USERNAME}
389389
password=${AZ_MYSQL_NON_ADMIN_PASSWORD}
@@ -433,7 +433,7 @@ public class DemoApplication {
433433
public static void main(String[] args) throws Exception {
434434
log.info("Loading application properties");
435435
Properties properties = new Properties();
436-
properties.load(DemoApplication.class.getClassLoader().getResourceAsStream("application.properties"));
436+
properties.load(DemoApplication.class.getClassLoader().getResourceAsStream("database.properties"));
437437

438438
log.info("Connecting to the database");
439439
Connection connection = DriverManager.getConnection(properties.getProperty("url"), properties);
@@ -464,12 +464,12 @@ public class DemoApplication {
464464

465465
[Having any issues? Let us know.](https://github.com/MicrosoftDocs/azure-docs/issues)
466466

467-
This Java code will use the *application.properties* and the *schema.sql* files that you created earlier, in order to connect to the MySQL server and create a schema that will store your data.
467+
This Java code will use the *database.properties* and the *schema.sql* files that you created earlier, in order to connect to the MySQL server and create a schema that will store your data.
468468

469469
In this file, you can see that we commented methods to insert, read, update and delete data: you'll code those methods in the rest of this article, and you'll be able to uncomment them one after each other.
470470

471471
> [!NOTE]
472-
> The database credentials are stored in the *user* and *password* properties of the *application.properties* file. Those credentials are used when executing `DriverManager.getConnection(properties.getProperty("url"), properties);`, as the properties file is passed as an argument.
472+
> The database credentials are stored in the *user* and *password* properties of the *database.properties* file. Those credentials are used when executing `DriverManager.getConnection(properties.getProperty("url"), properties);`, as the properties file is passed as an argument.
473473
474474
> [!NOTE]
475475
> The `AbandonedConnectionCleanupThread.uncheckedShutdown();` line at the end is a MySQL driver specific command to destroy an internal thread when shutting down the application.

articles/mysql/single-server/connect-java.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Replace the placeholders with the following values, which are used throughout th
5656

5757
- `<YOUR_DATABASE_SERVER_NAME>`: The name of your MySQL server, which should be unique across Azure.
5858
- `<YOUR_AZURE_REGION>`: The Azure region you'll use. You can use `eastus` by default, but we recommend that you configure a region closer to where you live. You can see the full list of available regions by entering `az account list-locations`.
59-
- `<YOUR_LOCAL_IP_ADDRESS>`: The IP address of your local computer, from which you'll run your Spring Boot application. One convenient way to find it is to open [whatismyip.akamai.com](http://whatismyip.akamai.com/).
59+
- `<YOUR_LOCAL_IP_ADDRESS>`: The IP address of your local computer, from which you'll run your application. One convenient way to find it is to open [whatismyip.akamai.com](http://whatismyip.akamai.com/).
6060

6161
### [Password](#tab/password)
6262

@@ -345,14 +345,14 @@ This file is an [Apache Maven](https://maven.apache.org/) file that configures y
345345

346346
### Prepare a configuration file to connect to Azure Database for MySQL
347347

348-
Run the following script in the project root directory to create a *src/main/resources/application.properties* file and add configuration details:
348+
Run the following script in the project root directory to create a *src/main/resources/database.properties* file and add configuration details:
349349

350350
#### [Passwordless connection (Recommended)](#tab/passwordless)
351351

352352
```bash
353-
mkdir -p src/main/resources && touch src/main/resources/application.properties
353+
mkdir -p src/main/resources && touch src/main/resources/database.properties
354354

355-
cat << EOF > src/main/resources/application.properties
355+
cat << EOF > src/main/resources/database.properties
356356
url=jdbc:mysql://${AZ_DATABASE_SERVER_NAME}.mysql.database.azure.com:3306/${AZ_DATABASE_NAME}?sslMode=REQUIRED&serverTimezone=UTC&defaultAuthenticationPlugin=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin&authenticationPlugins=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin
357357
user=${AZ_MYSQL_AD_NON_ADMIN_USERNAME}@${AZ_DATABASE_SERVER_NAME}
358358
EOF
@@ -363,19 +363,19 @@ EOF
363363
> If you are using MysqlConnectionPoolDataSource class as the datasource in your application, please remove "defaultAuthenticationPlugin=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin" in the url.
364364
365365
```bash
366-
mkdir -p src/main/resources && touch src/main/resources/application.properties
366+
mkdir -p src/main/resources && touch src/main/resources/database.properties
367367

368-
cat << EOF > src/main/resources/application.properties
368+
cat << EOF > src/main/resources/database.properties
369369
url=jdbc:mysql://${AZ_DATABASE_SERVER_NAME}.mysql.database.azure.com:3306/${AZ_DATABASE_NAME}?sslMode=REQUIRED&serverTimezone=UTC&authenticationPlugins=com.azure.identity.providers.mysql.AzureIdentityMysqlAuthenticationPlugin
370370
user=${AZ_MYSQL_AD_NON_ADMIN_USERNAME}@${AZ_DATABASE_SERVER_NAME}
371371
EOF
372372
```
373373
#### [Password](#tab/password)
374374

375375
```bash
376-
mkdir -p src/main/resources && touch src/main/resources/application.properties
376+
mkdir -p src/main/resources && touch src/main/resources/database.properties
377377

378-
cat << EOF > src/main/resources/application.properties
378+
cat << EOF > src/main/resources/database.properties
379379
url=jdbc:mysql://${AZ_DATABASE_SERVER_NAME}.mysql.database.azure.com:3306/${AZ_DATABASE_NAME}?useSSL=true&sslMode=REQUIRED&serverTimezone=UTC
380380
user=${AZ_MYSQL_NON_ADMIN_USERNAME}@${AZ_DATABASE_SERVER_NAME}
381381
password=${AZ_MYSQL_NON_ADMIN_PASSWORD}
@@ -429,7 +429,7 @@ public class DemoApplication {
429429
public static void main(String[] args) throws Exception {
430430
log.info("Loading application properties");
431431
Properties properties = new Properties();
432-
properties.load(DemoApplication.class.getClassLoader().getResourceAsStream("application.properties"));
432+
properties.load(DemoApplication.class.getClassLoader().getResourceAsStream("database.properties"));
433433

434434
log.info("Connecting to the database");
435435
Connection connection = DriverManager.getConnection(properties.getProperty("url"), properties);
@@ -458,12 +458,12 @@ public class DemoApplication {
458458
}
459459
```
460460

461-
This Java code will use the *application.properties* and the *schema.sql* files that you created earlier. After connecting to the MySQL server, you can create a schema to store your data.
461+
This Java code will use the *database.properties* and the *schema.sql* files that you created earlier. After connecting to the MySQL server, you can create a schema to store your data.
462462

463463
In this file, you can see that we commented methods to insert, read, update and delete data. You'll implement those methods in the rest of this article, and you'll be able to uncomment them one after each other.
464464

465465
> [!NOTE]
466-
> The database credentials are stored in the *user* and *password* properties of the *application.properties* file. Those credentials are used when executing `DriverManager.getConnection(properties.getProperty("url"), properties);`, as the properties file is passed as an argument.
466+
> The database credentials are stored in the *user* and *password* properties of the *database.properties* file. Those credentials are used when executing `DriverManager.getConnection(properties.getProperty("url"), properties);`, as the properties file is passed as an argument.
467467
468468
> [!NOTE]
469469
> The `AbandonedConnectionCleanupThread.uncheckedShutdown();` line at the end is a MySQL driver command to destroy an internal thread when shutting down the application. You can safely ignore this line.

0 commit comments

Comments
 (0)