1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/tutorials/java

Connect to SQL Database by using Java with JDBC on Windows

[Java code sample] (sample_java.java) that you can use to connect to Azure SQL Database. The Java sample relies on the Java Development Kit (JDK) version 8. The sample connects to an Azure SQL Database by using the JDBC driver.

Requirements

Create a database, retrieve your connection string

The Java sample relies on the AdventureWorks sample database. If you do not already have AdventureWorks, you can see how to create it at the following topic: Create your first Azure SQL Database