Skip to content

Commit 368d1c9

Browse files
authored
Merge pull request #102330 from john-par/1666437-quickstart-consistency-postgresql
1666437, quickstart consistency postgresql
2 parents e807e7d + 9744d7b commit 368d1c9

File tree

7 files changed

+33
-27
lines changed

7 files changed

+33
-27
lines changed

articles/postgresql/connect-java.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,26 @@ ms.custom: seo-java-august2019
1212
---
1313

1414
# Quickstart: Use Java to connect to and query data in Azure Database for PostgreSQL - Single Server
15-
This quickstart demonstrates how to connect to an Azure Database for PostgreSQL using a Java application. It shows how to use SQL statements to query, insert, update, and delete data in the database. The steps in this article assume that you are familiar with developing using Java, and are new to working with Azure Database for PostgreSQL.
15+
16+
In this quickstart, you connect to an Azure Database for PostgreSQL using a Java application. It shows how to use SQL statements to query, insert, update, and delete data in the database. The steps in this article assume that you are familiar with developing using Java, and are new to working with Azure Database for PostgreSQL.
1617

1718
## Prerequisites
18-
This quickstart uses the resources created in either of these guides as a starting point:
19-
- [Create DB - Portal](quickstart-create-server-database-portal.md)
20-
- [Create DB - Azure CLI](quickstart-create-server-database-azure-cli.md)
2119

22-
You also need to:
23-
- Download the [PostgreSQL JDBC Driver](https://jdbc.postgresql.org/download.html) matching your version of Java and the Java Development Kit.
24-
- Include the PostgreSQL JDBC jar file (for example postgresql-42.1.1.jar) in your application classpath. For more information, see [classpath details](https://jdbc.postgresql.org/documentation/head/classpath.html).
20+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
21+
22+
- Completion of [Quickstart: Create an Azure Database for PostgreSQL server in the Azure portal](quickstart-create-server-database-portal.md) or [Quickstart: Create an Azure Database for PostgreSQL using the Azure CLI](quickstart-create-server-database-azure-cli.md).
23+
24+
- [PostgreSQL JDBC Driver](https://jdbc.postgresql.org/download.html) - match your version of Java and the Java Development Kit.
25+
- [Classpath details](https://jdbc.postgresql.org/documentation/head/classpath.html) - Include the PostgreSQL JDBC jar file (for example postgresql-42.1.1.jar) in your application classpath.
2526

2627
## Get connection information
2728
Get the connection information needed to connect to the Azure Database for PostgreSQL. You need the fully qualified server name and login credentials.
2829

29-
1. Log in to the [Azure portal](https://portal.azure.com/).
30-
2. From the left-hand menu in Azure portal, select **All resources**, and then search for the server you have created (such as **mydemoserver**).
31-
3. Select the server name.
32-
4. From the server's **Overview** panel, make a note of the **Server name** and **Server admin login name**. If you forget your password, you can also reset the password from this panel.
33-
![Azure Database for PostgreSQL server name](./media/connect-java/azure-database-postgresql-server-name.png)
30+
1. In the [Azure portal](https://portal.azure.com/), search for and select the server you have created (such as **mydemoserver**).
31+
32+
1. From the server's **Overview** panel, make a note of the **Server name** and **Admin username**. If you forget your password, you can also reset the password from this panel.
33+
34+
![Azure Database for PostgreSQL connection string](./media/connect-java/server-details-azure-database-postgresql.png)
3435

3536
## Connect, create table, and insert data
3637
Use the following code to connect and load the data into the database using the function with an **INSERT** SQL statement. The methods [getConnection()](https://www.postgresql.org/docs/7.4/static/jdbc-use.html), [createStatement()](https://jdbc.postgresql.org/documentation/head/query.html), and [executeQuery()](https://jdbc.postgresql.org/documentation/head/query.html) are used to connect to the database, drop, and create the table. The [prepareStatement](https://jdbc.postgresql.org/documentation/head/query.html) object is used to build the insert commands, with setString() and setInt() to bind the parameter values. Method [executeUpdate()](https://jdbc.postgresql.org/documentation/head/update.html) runs the command for each set of parameters.

articles/postgresql/connect-nodejs.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ ms.custom: seo-javascript-september2019, seo-javascript-october2019
1212
---
1313

1414
# Quickstart: Use Node.js to connect and query data in Azure Database for PostgreSQL - Single Server
15-
This quickstart demonstrates how to connect to an Azure Database for PostgreSQL using a [Node.js](https://nodejs.org/) application. It shows how to use SQL statements to query, insert, update, and delete data in the database. The steps in this article assume that you are familiar with developing using Node.js, and are new to working with Azure Database for PostgreSQL.
15+
16+
In this quickstart, you connect to an Azure Database for PostgreSQL using a Node.js application. It shows how to use SQL statements to query, insert, update, and delete data in the database. The steps in this article assume that you are familiar with developing using Node.js, and are new to working with Azure Database for PostgreSQL.
1617

1718
## Prerequisites
18-
This quickstart uses the resources created in either of these guides as a starting point:
19-
- [Create DB - Portal](quickstart-create-server-database-portal.md)
20-
- [Create DB - CLI](quickstart-create-server-database-azure-cli.md)
2119

22-
You also need to:
23-
- Install [Node.js](https://nodejs.org)
20+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
21+
22+
- Completion of [Quickstart: Create an Azure Database for PostgreSQL server in the Azure portal](quickstart-create-server-database-portal.md) or [Quickstart: Create an Azure Database for PostgreSQL using the Azure CLI](quickstart-create-server-database-azure-cli.md).
23+
24+
- [Node.js](https://nodejs.org)
2425

2526
## Install pg client
2627
Install [pg](https://www.npmjs.com/package/pg), which is a PostgreSQL client for Node.js.
@@ -38,11 +39,11 @@ npm list
3839
## Get connection information
3940
Get the connection information needed to connect to the Azure Database for PostgreSQL. You need the fully qualified server name and login credentials.
4041

41-
1. Log in to the [Azure portal](https://portal.azure.com/).
42-
2. From the left-hand menu in Azure portal, select **All resources**, and then search for the server you have created (such as **mydemoserver**).
43-
3. Select the server name.
44-
4. From the server's **Overview** panel, make a note of the **Server name** and **Server admin login name**. If you forget your password, you can also reset the password from this panel.
45-
![Azure Database for PostgreSQL connection string](./media/connect-nodejs/server-details-azure-database-postgresql.png)
42+
1. In the [Azure portal](https://portal.azure.com/), search for and select the server you have created (such as **mydemoserver**).
43+
44+
1. From the server's **Overview** panel, make a note of the **Server name** and **Admin username**. If you forget your password, you can also reset the password from this panel.
45+
46+
![Azure Database for PostgreSQL connection string](./media/connect-nodejs/server-details-azure-database-postgresql.png)
4647

4748
## Running the JavaScript code in Node.js
4849
You may launch Node.js from the Bash shell, Terminal, or Windows Command Prompt by typing `node`, then run the example JavaScript code interactively by copy and pasting it onto the prompt. Alternatively, you may save the JavaScript code into a text file and launch `node filename.js` with the file name as a parameter to run it.

articles/postgresql/connect-python.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ ms.topic: quickstart
1010
ms.date: 11/07/2019
1111
---
1212

13-
# Use Python to connect and query data in Azure Database for PostgreSQL - Single Server
14-
This quickstart demonstrates how to work with an Azure Database for PostgreSQL using Python on macOS, Ubuntu Linux, or Windows. The quickstart shows how to connect to the database and use SQL statements to query, insert, update, and delete data. The article assumes that you're familiar with Python, but new to working with Azure Database for PostgreSQL.
13+
# Quickstart: Use Python to connect and query data in Azure Database for PostgreSQL - Single Server
14+
15+
In this quickstart, you work with an Azure Database for PostgreSQL using Python on macOS, Ubuntu Linux, or Windows. The quickstart shows how to connect to the database and use SQL statements to query, insert, update, and delete data. The article assumes that you're familiar with Python, but new to working with Azure Database for PostgreSQL.
1516

1617
## Prerequisites
17-
- An Azure Database for PostgreSQL - Single Server, created by using the steps in [Quickstart: Create an Azure Database for PostgreSQL server in the Azure portal](quickstart-create-server-database-portal.md) or [Quickstart: Create an Azure Database for PostgreSQL using the Azure CLI](quickstart-create-server-database-azure-cli.md).
18+
19+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
20+
21+
- Completion of [Quickstart: Create an Azure Database for PostgreSQL server in the Azure portal](quickstart-create-server-database-portal.md) or [Quickstart: Create an Azure Database for PostgreSQL using the Azure CLI](quickstart-create-server-database-azure-cli.md).
1822

1923
- [Python](https://www.python.org/downloads/) 2.7.9+ or 3.4+.
2024

21-
- The latest update of [pip](https://pip.pypa.io/en/stable/installing/) package installer, installed using `pip install -U pip`.
25+
- Latest [pip](https://pip.pypa.io/en/stable/installing/) package installer.
2226

2327
## Install the Python libraries for PostgreSQL
2428
The [psycopg2](https://pypi.python.org/pypi/psycopg2/) module enables connecting to and querying a PostgreSQL database, and is available as a Linux, macOS, or Windows [wheel](https://pythonwheels.com/) package. Install the binary version of the module, including all the dependencies. For more information about `psycopg2` installation and requirements, see [Installation](http://initd.org/psycopg/docs/install.html).
Binary file not shown.
94.1 KB
Loading
42.8 KB
Loading
8.94 KB
Loading

0 commit comments

Comments
 (0)