Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The three-step getting-started guide is now a single Java and Maven quickstart. Use its complete application instead of the previous proof-of-concept snippets.
Connect
Follow Configure the connection to keep endpoint settings and credentials outside source code. For Azure SQL and SQL database in Fabric, the quickstart uses interactive Microsoft Entra authentication during local development and explains managed identity for Azure hosting.
Execute a query
Copy the complete Java application, then run it and verify the result. The application binds a query parameter and uses try-with-resources to close the connection, statement, and result set.
Insert a row
The quickstart uses a read-only query, so it doesn't insert sample data. For a separate example of inserting a row and retrieving its identity value, see Using auto-generated keys.