For developers, connecting to a SQL database in Azure works exactly the same as connecting to an on-premises SQL Server instance. We can use JDBC or JPA. The following two examples assume that you've created the Person table and inserted some data, as described in the previous section.
Connecting to Azure SQL from Java
Connecting using JDBC
Let's make a connection and print our data using JDBC. Create a new Gradle project using Eclipse. Gradle simplifies dependency management for our examples. In this case, it will manage the Microsoft JDBC Driver for SQL. Update the build.gradle file, as shown here:
apply plugin: 'java-library'
repositories {
jcenter()
}
dependencies {
runtime 'com.microsoft...