Overview
ISO/IEC 19075-4:2021 is part of the ISO/IEC 19075 series that provides a tutorial-style, standards-based guide for using SQL routines and user-defined types implemented in the Java™ programming language. It explains how Java methods and classes can be installed, referenced and invoked from SQL environments (the SQL/JRT facility), and shows practical examples for integrating Java logic with SQL statements and expressions.
Key topics and technical requirements
- Scope: Tutorial guidance for using Java-written routines (functions/procedures) and user-defined types in SQL expressions and statements.
- SQL/JRT components:
- Built-in schema SQLJ and built-in procedures such as SQLJ.INSTALL_JAR, SQLJ.REPLACE_JAR, SQLJ.REMOVE_JAR, and SQLJ.ALTER_JAVA_PATH for loading and managing Java JARs in the SQL catalog.
- Extensions to SQL DDL/DML: CREATE PROCEDURE/FUNCTION, DROP PROCEDURE/FUNCTION, CREATE TYPE, DROP TYPE, and extended GRANT/REVOKE semantics for Java JAR usage.
- Conventions for returning OUT/INOUT parameters and SQL result sets created by Java routines.
- Qualified referencing of Java class fields and methods from SQL and additional Information Schema views/columns to expose metadata.
- Installation & deployment: Guidance on packaging Java class files into JARs, installing them into the SQL system with SQLJ.INSTALL_JAR (including a JAR name used within SQL), and handling deployment descriptors and path resolution.
- Examples and behavior: Sample Java classes and methods (e.g., Routines1.region, Routines1.correctStates) illustrate mapping between Java methods and SQL functions/procedures, JDBC usage, null argument handling, overloading, static variables, and visibility/privilege considerations.
Applications and who should use this standard
- Database implementers and DBMS vendors adding or supporting the SQL/JRT facility (Java-based routines and types).
- Application developers and architects who need to implement stored procedures, UDFs or custom data types in Java and expose them to SQL clients.
- DBAs responsible for deploying Java routines and managing JARs, privileges, and Information Schema metadata.
- Teams integrating Java business logic with SQL queries for advanced processing, result-set generation, or custom type mapping.
Practical use cases include Java-based stored procedures that perform complex computation or JDBC access, Java-backed SQL user-defined types for rich data models, and migration patterns where Java logic replaces or complements server-side SQL logic.
Related standards
Intended for use with the SQL/ISO family, for example:
- ISO/IEC 9075-1, -2, -3, -4, -9, -10, -11, -13, -14, -15, -16 (SQL/Foundation and related parts).