You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/sql-database/sql-database-connect-query-java.md
+26-21Lines changed: 26 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Use Java to query
2
+
title: Use Java to query a database
3
3
description: Shows you how to use Java to create a program that connects to an Azure SQL database and query it using T-SQL statements.
4
4
services: sql-database
5
5
ms.service: sql-database
@@ -12,36 +12,41 @@ ms.reviewer: v-masebo
12
12
ms.date: 03/25/2019
13
13
ms.custom: seo-java-july2019. seo-java-august2019
14
14
---
15
-
# Quickstart: Use Java to connect to and query an Azure SQL database
15
+
# Quickstart: Use Java to query an Azure SQL database
16
16
17
-
This article demonstrates how to use [Java](/sql/connect/jdbc/microsoft-jdbc-driver-for-sql-server) to connect to an Azure SQL database. You can then use T-SQL statements to query data.
17
+
In this quickstart, you use Java to connect to an Azure SQL database and use T-SQL statements to query data.
18
18
19
19
## Prerequisites
20
20
21
-
To complete this sample, make sure you have the following prerequisites:
21
+
- 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).
22
22
23
-
- An Azure SQL database. You can use one of these quickstarts to create and then configure a database in Azure SQL Database:
| Configure |[Server-level IP firewall rule](sql-database-server-level-firewall-rule.md)|[Connectivity from a VM](sql-database-managed-instance-configure-vm.md)|
31
-
|||[Connectivity from on-site](sql-database-managed-instance-configure-p2s.md)
32
-
|Load data|Adventure Works loaded per quickstart|[Restore Wide World Importers](sql-database-managed-instance-get-started-restore.md)
33
-
|||Restore or import Adventure Works from [BACPAC](sql-database-import.md) file from [GitHub](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works)|
23
+
- An [Azure SQL database](sql-database-single-database-get-started.md)
34
24
35
-
> [!IMPORTANT]
36
-
> The scripts in this article are written to use the Adventure Works database. With a managed instance, you must either import the Adventure Works database into an instance database or modify the scripts in this article to use the Wide World Importers database.
Install Homebrew and Java, then install Maven using steps **1.2** and **1.3** in [Create Java apps using SQL Server on macOS](https://www.microsoft.com/sql-server/developer-get-started/java/mac/).
30
+
31
+
# [Ubuntu](#tab/ubuntu)
32
+
33
+
Install Java, the Java Development Kit, then install Maven using steps **1.2**, **1.3**, and **1.4** in [Create Java apps using SQL Server on Ubuntu](https://www.microsoft.com/sql-server/developer-get-started/java/ubuntu/).
34
+
35
+
# [Windows](#tab/windows)
37
36
38
-
-Java-related software installed for your operating system:
37
+
Install Java, then install Maven using steps **1.2** and **1.3** in [Create Java apps using SQL Server on Windows](https://www.microsoft.com/sql-server/developer-get-started/java/windows/).
39
38
40
-
-**MacOS**, install Homebrew and Java, then install Maven. See [Step 1.2 and 1.3](https://www.microsoft.com/sql-server/developer-get-started/java/mac/).
39
+
---
41
40
42
-
-**Ubuntu**, install Java, the Java Development Kit, then install Maven. See [Step 1.2, 1.3, and 1.4](https://www.microsoft.com/sql-server/developer-get-started/java/ubuntu/).
41
+
> [!IMPORTANT]
42
+
> The scripts in this article are written to use the **Adventure Works** database.
43
43
44
-
-**Windows**, install Java, then install Maven. See [Step 1.2 and 1.3](https://www.microsoft.com/sql-server/developer-get-started/java/windows/).
44
+
> [!NOTE]
45
+
> You can optionally choose to use an Azure SQL managed instance.
46
+
>
47
+
> To create and configure, use the [Azure Portal](sql-database-managed-instance-get-started.md), [PowerShell](scripts/sql-database-create-configure-managed-instance-powershell.md), or [CLI](https://medium.com/azure-sqldb-managed-instance/working-with-sql-managed-instance-using-azure-cli-611795fe0b44), then setup [on-site](sql-database-managed-instance-configure-p2s.md) or [VM](sql-database-managed-instance-configure-vm.md) connectivity.
48
+
>
49
+
> To load data, see [restore with BACPAC](sql-database-import.md) with the [Adventure Works](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works) file, or see [restore the Wide World Importers database](sql-database-managed-instance-get-started-restore.md).
# Quickstart: Use Node.js to query an Azure SQL database
16
16
17
-
This quickstart demonstrates how to use [Node.js](https://nodejs.org) to connect to an Azure SQL database. You can then use T-SQL statements to query data.
17
+
In this quickstart, you use Node.js to connect to an Azure SQL database and use T-SQL statements to query data.
18
18
19
19
## Prerequisites
20
20
21
-
To complete this sample, make sure you have the following prerequisites:
21
+
- 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).
22
22
23
-
- An Azure SQL database. You can use one of these quickstarts to create and then configure a database in Azure SQL Database:
23
+
- An [Azure SQL database](sql-database-single-database-get-started.md)
| Configure |[Server-level IP firewall rule](sql-database-server-level-firewall-rule.md)|[Connectivity from a VM](sql-database-managed-instance-configure-vm.md)|
31
-
|||[Connectivity from on-site](sql-database-managed-instance-configure-p2s.md)
32
-
|Load data|Adventure Works loaded per quickstart|[Restore Wide World Importers](sql-database-managed-instance-get-started-restore.md)
33
-
|||Restore or import Adventure Works from [BACPAC](sql-database-import.md) file from [GitHub](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works)|
34
-
|||
27
+
# [macOS](#tab/macos)
35
28
36
-
> [!IMPORTANT]
37
-
> The scripts in this article are written to use the Adventure Works database. With a managed instance, you must either import the Adventure Works database into an instance database or modify the scripts in this article to use the Wide World Importers database.
29
+
Install Homebrew and Node.js, then install the ODBC driver and SQLCMD using steps **1.2** and **1.3** in [Create Node.js apps using SQL Server on macOS](https://www.microsoft.com/sql-server/developer-get-started/node/mac/).
38
30
31
+
# [Ubuntu](#tab/ubuntu)
39
32
40
-
-Node.js-related software for your operating system:
33
+
Install Node.js, then install the ODBC driver and SQLCMD using steps **1.2** and **1.3** in [Create Node.js apps using SQL Server on Ubuntu](https://www.microsoft.com/sql-server/developer-get-started/node/ubuntu/).
41
34
42
-
-**MacOS**, install Homebrew and Node.js, then install the ODBC driver and SQLCMD. See [Step 1.2 and 1.3](https://www.microsoft.com/sql-server/developer-get-started/node/mac/).
43
-
44
-
-**Ubuntu**, install Node.js, then install the ODBC driver and SQLCMD. See [Step 1.2 and 1.3](https://www.microsoft.com/sql-server/developer-get-started/node/ubuntu/).
45
-
46
-
-**Windows**, install Chocolatey and Node.js, then install the ODBC driver and SQLCMD. See [Step 1.2 and 1.3](https://www.microsoft.com/sql-server/developer-get-started/node/windows/).
35
+
# [Windows](#tab/windows)
36
+
37
+
Install Chocolatey and Node.js, then install the ODBC driver and SQLCMD using steps **1.2** and **1.3** in [Create Node.js apps using SQL Server on Windows](https://www.microsoft.com/sql-server/developer-get-started/node/windows/).
38
+
39
+
---
40
+
41
+
> [!IMPORTANT]
42
+
> The scripts in this article are written to use the **Adventure Works** database.
43
+
44
+
> [!NOTE]
45
+
> You can optionally choose to use an Azure SQL managed instance.
46
+
>
47
+
> To create and configure, use the [Azure Portal](sql-database-managed-instance-get-started.md), [PowerShell](scripts/sql-database-create-configure-managed-instance-powershell.md), or [CLI](https://medium.com/azure-sqldb-managed-instance/working-with-sql-managed-instance-using-azure-cli-611795fe0b44), then setup [on-site](sql-database-managed-instance-configure-p2s.md) or [VM](sql-database-managed-instance-configure-vm.md) connectivity.
48
+
>
49
+
> To load data, see [restore with BACPAC](sql-database-import.md) with the [Adventure Works](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works) file, or see [restore the Wide World Importers database](sql-database-managed-instance-get-started-restore.md).
Copy file name to clipboardExpand all lines: articles/sql-database/sql-database-connect-query-python.md
+36-22Lines changed: 36 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: 'Quickstart: Use Python to query'
2
+
title: Use Python to query a database
3
3
description: This topic shows you how to use Python to create a program that connects to an Azure SQL database and query it using Transact-SQL statements.
4
4
services: sql-database
5
5
ms.service: sql-database
@@ -14,35 +14,49 @@ ms.date: 03/25/2019
14
14
---
15
15
# Quickstart: Use Python to query an Azure SQL database
16
16
17
-
This article demonstrates how to use [Python](https://python.org) to connect to an Azure SQL database and use Transact-SQL statements to query data. For further SDK details, check out our [reference](https://docs.microsoft.com/python/api/overview/azure/sql) documentation, the [pyodbc GitHub repository](https://github.com/mkleehammer/pyodbc/wiki/), and a [pyodbc sample](https://github.com/mkleehammer/pyodbc/wiki/Getting-started).
17
+
In this quickstart, you use Python to connect to an Azure SQL database and use T-SQL statements to query data.
18
18
19
19
## Prerequisites
20
20
21
-
To complete this quickstart, make sure you have the following:
21
+
- 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).
22
22
23
-
- An Azure SQL database. You can use one of these quickstarts to create and then configure a database in Azure SQL Database:
23
+
- An [Azure SQL database](sql-database-single-database-get-started.md)
24
+
25
+
-[Python](https://python.org/downloads) 3 and related software
| Configure |[Server-level IP firewall rule](sql-database-server-level-firewall-rule.md)|[Connectivity from a VM](sql-database-managed-instance-configure-vm.md)|
31
-
|||[Connectivity from on-site](sql-database-managed-instance-configure-p2s.md)
32
-
|Load data|Adventure Works loaded per quickstart|[Restore Wide World Importers](sql-database-managed-instance-get-started-restore.md)
33
-
|||Restore or import Adventure Works from [BACPAC](sql-database-import.md) file from [GitHub](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works)|
34
-
|||
27
+
# [macOS](#tab/macos)
35
28
36
-
> [!IMPORTANT]
37
-
> The scripts in this article are written to use the Adventure Works database. With a managed instance, you must either import the Adventure Works database into an instance database or modify the scripts in this article to use the Wide World Importers database.
38
-
39
-
- Python and related software for your operating system:
40
-
41
-
-**MacOS**: Install Homebrew and Python, install the ODBC driver and SQLCMD, and then install the Python driver for SQL Server. See Steps 1.2, 1.3, and 2.1 in [Create Python apps using SQL Server on macOS](https://www.microsoft.com/sql-server/developer-get-started/python/mac/). For more information, see [Install the Microsoft ODBC Driver on Linux and macOS](https://docs.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
29
+
To install Homebrew and Python, the ODBC driver and SQLCMD, and the Python driver for SQL Server, use steps **1.2**, **1.3**, and **2.1** in [create Python apps using SQL Server on macOS](https://www.microsoft.com/sql-server/developer-get-started/python/mac/).
30
+
31
+
For further information, see [Microsoft ODBC Driver on macOS](/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
32
+
33
+
# [Ubuntu](#tab/ubuntu)
34
+
35
+
To install Python and other required packages, use `sudo apt-get install python python-pip gcc g++ build-essential`.
36
+
37
+
To install the ODBC driver, SQLCMD, and the Python driver for SQL Server, see [configure an environment for pyodbc Python development](/sql/connect/python/pyodbc/step-1-configure-development-environment-for-pyodbc-python-development#linux).
38
+
39
+
For further information, see [Microsoft ODBC Driver on Linux](/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
40
+
41
+
# [Windows](#tab/windows)
42
+
43
+
To install Python, the ODBC driver and SQLCMD, and the Python driver for SQL Server, see [configure an environment for pyodbc Python development](/sql/connect/python/pyodbc/step-1-configure-development-environment-for-pyodbc-python-development#windows).
44
+
45
+
For further information, see [Microsoft ODBC Driver](/sql/connect/odbc/microsoft-odbc-driver-for-sql-server).
46
+
47
+
---
48
+
49
+
> [!IMPORTANT]
50
+
> The scripts in this article are written to use the **Adventure Works** database.
42
51
43
-
-**Ubuntu**: Install Python and other required packages with `sudo apt-get install python python-pip gcc g++ build-essential`. Download and install the ODBC driver, SQLCMD, and the Python driver for SQL Server. For instructions, see [Configure a development environment for pyodbc Python development](/sql/connect/python/pyodbc/step-1-configure-development-environment-for-pyodbc-python-development#linux).
52
+
> [!NOTE]
53
+
> You can optionally choose to use an Azure SQL managed instance.
54
+
>
55
+
> To create and configure, use the [Azure Portal](sql-database-managed-instance-get-started.md), [PowerShell](scripts/sql-database-create-configure-managed-instance-powershell.md), or [CLI](https://medium.com/azure-sqldb-managed-instance/working-with-sql-managed-instance-using-azure-cli-611795fe0b44), then setup [on-site](sql-database-managed-instance-configure-p2s.md) or [VM](sql-database-managed-instance-configure-vm.md) connectivity.
56
+
>
57
+
> To load data, see [restore with BACPAC](sql-database-import.md) with the [Adventure Works](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works) file, or see [restore the Wide World Importers database](sql-database-managed-instance-get-started-restore.md).
44
58
45
-
-**Windows**: Install Python, the ODBC driver and SQLCMD, and the Python driver for SQL Server. For instructions, see [Configure a development environment for pyodbc Python development](/sql/connect/python/pyodbc/step-1-configure-development-environment-for-pyodbc-python-development#windows).
59
+
To further explore Python and the Azure SQL database, see [Azure SQL database libraries for Python](/python/api/overview/azure/sql), the [pyodbc repository](https://github.com/mkleehammer/pyodbc/wiki/), and a [pyodbc sample](https://github.com/mkleehammer/pyodbc/wiki/Getting-started).
0 commit comments