title | titleSuffix | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | ms.custom | monikerRange | |
---|---|---|---|---|---|---|---|---|---|---|---|
What is the Java Language Extension? |
SQL Server Language Extensions |
The Java Language Extension is a feature of SQL Server used for executing external Java code. Relational data can be used in the external Java code using the extensibility framework. |
rwestMSFT |
randolphwest |
04/29/2024 |
sql |
language-extensions |
overview |
|
>=sql-server-ver15 || >=sql-server-linux-ver15 |
[!INCLUDE sqlserver2019-and-later]
The Java Language Extension is a feature of SQL Server used for executing external Java code. The relational data can be used in the external Java code using the extensibility framework. The Java Language Extension is part of SQL Server Language Extensions.
The default Java runtime is Zulu Open JRE. You can also use another Java JRE or SDK.
The Java Language Extension uses the extensibility framework for executing external Java code. Code execution is isolated from the core engine processes, but fully integrated with SQL Server query execution. You can execute Java code at the data's source, eliminating the need to pull data across the network.
The external Java language is defined with CREATE EXTERNAL LANGUAGE. The system stored procedure sp_execute_external_script is used as the interface for executing the Java code.
-
Install SQL Server Java Language Extension on Windows or on Linux.
-
Configure development tools.
- Use the IDE you prefer for developing Java code.
- Install the Microsoft Extensibility SDK for Java for SQL Server to execute Java code on SQL Server.
- Use Azure Data Studio for executing external code on SQL Server.
- Use the system stored procedure sp_execute_external_script to execute your Java code on SQL Server.
-
Write your first Java code. Use the following tutorial as a starting point. Tutorial: Search for a string using regular expressions (regex) in Java
The number of values in input and output buffers can't exceed MAX_INT (2^31-1)
, since that is the maximum number of elements that can be allocated in an array in Java.