Microsoft JDBC Driver for SQL Server

Microsoft JDBC Driver for SQL Server

Official Java database driver for SQL Server

Description

A Java application needs to reach SQL Server, and what turns up in a search is either a decade-old jtds build or a jar from a forum post — which then turns out not to support Always Encrypted, not to understand Entra ID, and to get time zones wrong. Microsoft's own driver is the answer to that: a pure-Java Type 4 driver you put on the classpath and use through the standard JDBC API, with no native client installed on the machine.

It tracks what SQL Server and Azure SQL actually do. `encrypt=true` in the connection string turns on TLS, Always Encrypted columns are decrypted transparently in the driver, and each Microsoft Entra ID flow has its own authentication parameter. Being pure Java, it runs wherever a JVM does — Windows, Linux, macOS, Solaris — with nothing extra inside a container. MIT licensed, with the source on GitHub.

Features



Standard JDBC: implements the JDBC specification, so DriverManager, Connection and PreparedStatement work as normal and Hibernate, MyBatis or Spring Data need no special adapter.

Connection strings that just work: `jdbc:sqlserver://host:1433;databaseName=mydb;encrypt=true`, with timeouts, pooling, failover partner and application name as further semicolon-separated properties.

Several authentication modes: SQL login, Windows integrated authentication and Microsoft Entra ID — password, managed identity, service principal and interactive — all selected through the authentication parameter.

Transparent Always Encrypted: encrypted columns are decrypted inside the driver, so application code sees plaintext and the keys never reach the database engine.

One driver for the whole family: SQL Server, Azure SQL Database, Azure SQL Managed Instance and Azure Synapse all connect through it — changing target means changing the connection string.

Pure Java, so it travels: no native library dependency, which is what keeps container images free of ODBC layers.

Batching and streaming: bulk insert and streaming reads of large objects mean a big result set does not have to be held in memory.

MIT open source: the source is public on GitHub, so problems can be filed as issues rather than waited on.