Overview
ISO/IEC 19075-3:2021 provides guidance for embedding the SQL database language inside programs written in the Java programming language. The standard explains how to integrate SQL expressions and statements into Java source, describes design goals (such as binary portability and compile-time checking), and documents runtime profile customization and utilities that enable database-specific behavior. This is commonly referred to when implementing or using SQL embedded in Java (SQL/OLB / SQLJ) solutions and when deciding between embedded SQL and lower-level APIs like JDBC.
Key topics and technical requirements
- Embedding SQL in Java: Rules and recommendations for placing SQL expressions and statements directly in Java code, including host expressions and host variables.
- Design goals: Support for compile-time SQL syntactic/semantic checking, location-independent SQL semantics, binary portability, and shared SQL connection usage between SQL/OLB and JDBC environments.
- Advantages over JDBC: Smaller, higher-level source programs; potential for translator compile-time type checking; direct embedding of Java host expressions; stronger typing and simplified SQL-invoked routine invocation.
- Profile customization: Mechanisms to add implementation-specific SQL execution control via serializable profile customizers and runtime interfaces (for example, SQLJ.runtime.profile.RTStatement, RTResultSet, ConnectedProfile).
- Profile customization process: Steps for discovering, deserializing, customizing, and reserializing profiles (JAR-based profiles), enabling SQL implementations to register hooks for particular DBMS behavior.
- Runtime and utilities: Recommendations for tools (CLI, GUI/IDE integrations, installers) to automate profile customization and precompile/optimize embedded SQL.
- Examples and features: Iterators, binding strategies (positional and named), connection contexts, batching, result mapping, user-defined types, and techniques to obtain java.sql.ResultSet objects from SQL/OLB iterators.
Applications and users
Who uses ISO/IEC 19075-3:
- Java application developers who want to embed SQL directly in their code for stronger typing and simpler source.
- Database vendors and middleware vendors implementing SQL/OLB translators or runtime customizations.
- Tool and IDE developers building precompilers, profile customization utilities, and migration tools.
- System integrators targeting binary-portable Java database applications across multiple SQL implementations.
Practical benefits:
- Cleaner Java source with less boilerplate than JDBC.
- Compile-time SQL checks and safer runtime behavior.
- Easier portability and DB-specific optimization through profile customization.
Related standards
- ISO/IEC 9075 series (SQL/Framework and Object Language Bindings): parts 1, 2, 3, 4, 9–16 as listed in the standard
- Java Language Specification (Java SE editions)
- JDBC Specification (e.g., JDBC 4.3)
Keywords: SQL embedded in Java, SQL/OLB, SQLJ, embedded SQL, JDBC alternative, profile customization, binary portability, Java database integration.