Information technology - Database languages SQL - Part 13: SQL Routines and types using the Java TM programming language (SQL/JRT)

ISO/IEC 9075-13:2016 specifies the ability to invoke static methods written in the Java? programming language as SQL-invoked routines and to use classes defined in the Java programming language as SQL structured user-defined types. (Java is a registered trademark of Oracle Corporation and/or its affiliates.)

Technologies de l'information — Langages de base de données SQL — Partie 13: Routines et types de SQL utilisant le langage de programmation Java TM (SQL/JRT)

General Information

Status
Published
Publication Date
31-May-2023
Current Stage
9092 - International Standard to be revised
Start Date
22-Jun-2025
Completion Date
30-Oct-2025
Ref Project

Relations

Overview

ISO/IEC 9075-13:2023 - commonly called SQL/JRT - is the international standard that defines how the Java programming language is integrated with the SQL database language. Specifically, it specifies the ability to invoke static Java methods as SQL‑invoked routines and to use Java classes as SQL structured user‑defined types (UDTs). The fifth edition (2023) updates deployment artifacts, conformance guidance and aligns editorial aspects with the 2023 family of ISO/IEC 9075 standards.

Key topics and technical requirements

The standard organizes requirements across conceptual, syntactic and operational areas. Major technical topics include:

  • Java routines and types: rules for declaring and invoking Java static methods from SQL and for mapping Java classes to SQL structured types.
  • Parameter mapping and SQL result sets: how SQL types and Java types map, and how result sets and arrays are handled.
  • Data type conversion and UDT support: conversion mechanisms between SQL and Java objects (including references to SERIALIZABLE and SQLDATA conversion approaches).
  • Lexical and language elements: grammar for method invocation, new-object specifications, predicates and declarations used in SQL/JRT.
  • Schema definition and manipulation: DDL statements for defining Java-backed routines, user‑defined types and views.
  • JAR deployment and descriptors: handling of Java archives (JARs), deployment descriptor files and SQLJ built-in procedures (e.g., SQLJ.INSTALL_JAR, SQLJ.REMOVE_JAR, SQLJ.REPLACE_JAR, SQLJ.ALTER_JAVA_PATH).
  • Security and access control: privileges model, basic security considerations for invoking Java from SQL.
  • Exception and status handling: treatment of unhandled Java exceptions and associated SQLSTATE codes.
  • Information and definition schemas: views and base tables that expose metadata about Java routines, JAR usage and user‑defined types.
  • Conformance, optional features and implementation notes: rules for claiming conformance, plus informative annexes listing implementation‑defined/‑dependent elements and deprecated features.

Practical applications and users

ISO/IEC 9075-13:2023 is practically useful for:

  • Database vendors and DBMS implementers building or extending support for Java stored procedures, UDTs and JAR deployment.
  • Application architects and developers who embed Java logic inside SQL, want consistent parameter mapping, or need portable SQL/Java routines across compliant systems.
  • DevOps and DBAs managing JAR deployment, access privileges and lifecycle of Java routines in the database.
  • QA, compliance and tooling teams verifying conformance to SQL/JRT and interoperability with other parts of the ISO/IEC 9075 series.

Related standards

This part is intended to be used with other ISO/IEC 9075 parts (notably Parts 1–4 and other 2023 editions) that define core SQL syntax, data types, and conformance rules. For implementers, review the complete ISO/IEC 9075 family for full SQL conformance context.

Keywords: ISO/IEC 9075-13, SQL/JRT, SQL Java routines, Java stored procedures, SQL user-defined types, JAR deployment, parameter mapping, SQL resultsets, database standards.

Standard
ISO/IEC 9075-13:2023 - Information technology — Database languages SQL — Part 13: SQL Routines and types using the Java TM programming language (SQL/JRT) Released:1. 06. 2023
English language
132 pages
sale 15% off
Preview
sale 15% off
Preview

Frequently Asked Questions

ISO/IEC 9075-13:2023 is a standard published by the International Organization for Standardization (ISO). Its full title is "Information technology - Database languages SQL - Part 13: SQL Routines and types using the Java TM programming language (SQL/JRT)". This standard covers: ISO/IEC 9075-13:2016 specifies the ability to invoke static methods written in the Java? programming language as SQL-invoked routines and to use classes defined in the Java programming language as SQL structured user-defined types. (Java is a registered trademark of Oracle Corporation and/or its affiliates.)

ISO/IEC 9075-13:2016 specifies the ability to invoke static methods written in the Java? programming language as SQL-invoked routines and to use classes defined in the Java programming language as SQL structured user-defined types. (Java is a registered trademark of Oracle Corporation and/or its affiliates.)

ISO/IEC 9075-13:2023 is classified under the following ICS (International Classification for Standards) categories: 35.060 - Languages used in information technology. The ICS classification helps identify the subject area and facilitates finding related standards.

ISO/IEC 9075-13:2023 has the following relationships with other standards: It is inter standard links to ISO/IEC 9075-13:2016/Cor 2:2022. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC 9075-13:2023 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


INTERNATIONAL ISO/IEC
STANDARD 9075-13
Fifth edition
2023-06
Information technology — Database
languages SQL —
Part 13:
SQL Routines and types using the Java
TM programming language (SQL/
JRT)
Technologies de l'information — Langages de base de données SQL

Partie 13: Routines et types de SQL utilisant le langage de
programmation Java TM (SQL/JRT)
Reference number
© ISO/IEC 2023
© ISO/IEC 2023
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii
© ISO/IEC 2023 – All rights reserved

ISO/IEC9075-13:2023(E)
Contents Page
Foreword.vii
Introduction.ix
1 Scope.1
2 Normativereferences.2
3 Termsanddefinitions.3
4 Concepts.6
4.1 Notationsandconventions.6
4.1.1 Notations.6
4.1.2 Specificationofbuilt-inprocedures.6
4.1.3 Specificationofdeploymentdescriptorfiles.6
4.2 Javaprogramminglanguage.7
4.3 SQL-invokedroutines.8
4.3.1 CharacteristicsofSQL-invokedroutines.8
4.4 Javaclassnameresolution.9
4.5 SQLresultsets.10
4.6 Parameter mapping.10
4.7 UnhandledJavaexceptions.11
4.8 Data types.11
4.8.1 Hostlanguagedatatypes.11
4.9 User-defined types.12
4.9.1 Introductiontouser-definedtypes.12
4.9.2 User-definedtypecomparisonandassignment.13
4.9.3 User-definedtypedescriptor.13
4.9.4 Accessingstaticfields.14
4.9.5 ConvertingobjectsbetweenSQLandJava.15
4.9.5.1 IntroductiontoconversionofobjectsbetweenSQLandJava.15
4.9.5.2 SERIALIZABLE.15
4.9.5.3 SQLDATA.15
4.9.5.4 Developingforportability.16
4.10 Built-inprocedures.16
4.11 Basicsecuritymodel.16
4.11.1 Privileges.16
4.12 JARs.17
4.12.1 IntroductiontoJARs.17
4.12.2 Deploymentdescriptorfiles.17
5 Lexicalelements.19
5.1 and.19
5.2 Namesandidentifiers.20
©ISO/IEC2023–Allrightsreserved iii

ISO/IEC9075-13:2023(E)
6 Scalarexpressions.22
6.1 .22
6.2 .23
7 Predicates.24
7.1 .24
8 Additionalcommonrules.26
8.1 InvokinganSQL-invokedroutine.26
8.2 Executionofarray-returningfunctions.35
9 Additionalcommonelements.42
9.1 .42
9.2 .43
9.3 .44
9.4 .46
9.5 Javaroutinesignaturedetermination.47
10 Schemadefinitionandmanipulation.55
10.1 .55
10.2 .56
10.3 .57
10.4 .58
10.5 .62
10.6 .65
10.7 .66
10.8 .67
10.9 .70
10.10 .71
10.11 .72
10.12 .73
11 Accesscontrol.74
11.1 .74
11.2 .75
11.3 .76
12 Built-inprocedures.77
12.1 SQLJ.INSTALL_JAR procedure.77
12.2 SQLJ.REPLACE_JARprocedure.79
12.3 SQLJ.REMOVE_JAR procedure.81
12.4 SQLJ.ALTER_JAVA_PATHprocedure.83
13 Javatopics.85
13.1 Javafacilitiessupportedbythisdocument.85
13.1.1 Packagejava.sql.85
13.1.2 Systemproperties.85
13.2 Deploymentdescriptorfiles.86
14 InformationSchema.89
14.1 InformationSchemadigitalartifact.89
14.2 JAR_JAR_USAGE view.89
14.3 JARSview.90
iv ©ISO/IEC2023–Allrightsreserved

ISO/IEC9075-13:2023(E)
14.4 METHOD_SPECIFICATIONSview.91
14.5 ROUTINE_JAR_USAGE view.92
14.6 TYPE_JAR_USAGEview.93
14.7 USER_DEFINED_TYPESview.94
14.8 Shortnameviews.95
15 DefinitionSchema.96
15.1 DefinitionSchemadigitalartifact.96
15.2 JAR_JAR_USAGEbasetable.96
15.3 JARSbasetable.98
15.4 METHOD_SPECIFICATIONSbasetable.99
15.5 ROUTINE_JAR_USAGEbasetable.101
15.6 ROUTINESbasetable.102
15.7 TYPE_JAR_USAGEbasetable.103
15.8 USAGE_PRIVILEGESbasetable.104
15.9 USER_DEFINED_TYPESbasetable.105
16 Statuscodes.107
16.1 SQLSTATE.107
17 Conformance.108
17.1 ClaimsofconformancetoSQL/JRT.108
17.2 AdditionalconformancerequirementsforSQL/JRT.108
17.3 ImpliedfeaturerelationshipsofSQL/JRT.108
AnnexA(informative) SQLconformancesummary.109
AnnexB(informative) Implementation-defined elements.115
AnnexC(informative) Implementation-dependent elements.121
AnnexD(informative) SQLoptionalfeaturetaxonomy.123
AnnexE(informative) Deprecatedfeatures.125
AnnexF(informative) IncompatibilitieswithISO/IEC9075:2016.126
AnnexG(informative) DefectReportsnotaddressedinthiseditionofthisdocument.127
Bibliography.128
Index.129
©ISO/IEC2023–Allrightsreserved v

ISO/IEC9075-13:2023(E)
Tables
Table Page
1 Standardprogramminglanguages.42
2 System properties.85
3 SQLSTATEclassandsubclasscodes.107
4 ImpliedfeaturerelationshipsofSQL/JRT.108
A.1 FeaturedefinitionsoutsideofConformanceRules.109
D.1 Featuretaxonomyforoptionalfeatures.123
vi ©ISO/IEC2023–Allrightsreserved

Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Com-
mission) form the specialized system for worldwide standardization. National bodies that are members
of ISO or IEC participate in the development of International Standards through technical committees
established by the respective organization to deal with particular fields of technical activity. ISO and IEC
technical committees collaborate in fields of mutual interest. Other international organizations, govern-
mental and non-governmental, in liaison with ISO and IEC, also take part in the work.
The procedures used to develop this document and those intended for its further maintenance are de-
scribed in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the dif-
ferent types of document should be noted. This document was drafted in accordance with the editorial
rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives or www.iec.ch/members_experts/ref-
docs).
ISO and IEC draw attention to the possibility that the implementation of this document may involve the
use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any
claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC have
not received notice of (a) patent(s) which may be required to implement this document. However, imple-
menters are cautioned that this may not represent the latest information, which may be obtained from
the patent database available at www.iso.org/patents and https://patents.iec.ch. ISO and IEC shall not be
held responsible for identifying any or all such patent rights.
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expres-
sions related to conformity assessment, as well as information about ISO's adherence to the World Trade
Organization (WTO) principles in the Technical Barriers to Trade (TBT) see www.iso.org/iso/fore-
word.html. In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Sub-
committee SC 32, Data management and interchange.
This fifth edition cancels and replaces the fourth edition (ISO/IEC 9075-13:2016), which has been tech-
nically revised. It also incorporates the Technical Corrigenda ISO/IEC 9075-13:2016/Cor.1:2019 and
ISO/IEC 9075-13:2016/Cor.2:2022.
The main changes are as follows:
— improve the presentation and accuracy of the summaries of implementation-defined and implemen-
tation-dependent aspects of this document;
— introduction of several digital artifacts;
— alignment with updated ISO house style and other guidelines for creating standards.
This fifth edition of ISO/IEC 9075-13 is designed to be used in conjunction with the following editions of
other parts of the ISO/IEC 9075 series, all published in 2023:
— ISO/IEC 9075-1, sixth edition;
— ISO/IEC 9075-2, sixth edition;
© ISO/IEC 2023 – All rights reserved vii

— ISO/IEC 9075-3, sixth edition;
— ISO/IEC 9075-4, seventh edition;
— ISO/IEC 9075-9, fifth edition;
— ISO/IEC 9075-10, fifth edition;
— ISO/IEC 9075-11, fifth edition;
— ISO/IEC 9075-14, sixth edition;
— ISO/IEC 9075-15, second edition;
— ISO/IEC 9075-16, first edition.
A list of all parts in the ISO/IEC 9075 series can be found on the ISO and IEC websites.
Any feedback or questions on this document should be directed to the user’s national standards body. A
complete listing of these bodies can be found at www.iso.org/members.html and www.iec.ch/national-
committees.
viii © ISO/IEC 2023 – All rights reserved

ISO/IEC9075-13:2023(E)
Introduction
Theorganizationofthisdocumentisasfollows:
1) Clause1,“Scope”,specifiesthescopeofthisdocument.
2) Clause2,“Normativereferences”,identifiesadditionalstandardsthat,throughreferenceinthis
document,constituteprovisionsofthisdocument.
3) Clause3,“Termsanddefinitions”,definesthetermsanddefinitionsusedinthisdocument.
4) Clause4,“Concepts”,presentsconceptsusedinthedefinitionofJavaroutinesandtypes.
5) Clause5,“Lexicalelements”,definesanumberoflexicalelementsusedinthedefinitionofJava
routinesandtypes.
6) Clause6,“Scalarexpressions”,definestheelementsofthelanguagethatproducescalarvalues.
7) Clause7,“Predicates”,definesthepredicatesofthelanguage.
8) Clause8,“Additionalcommonrules”,specifiestherulesforassignmentsthatretrievedatafromor
storedataintoSQL-data,andformationrulesforsetoperations.
9) Clause9,“Additionalcommonelements”,definesadditionallanguageelementsthatareusedin
variouspartsofthelanguage.
10) Clause10,“Schemadefinitionandmanipulation”,definestheschemadefinitionandmanipulation
statementsassociatedwiththedefinitionofJavaroutinesandtypes.
11) Clause11,“Accesscontrol”,definesfacilitiesforcontrollingaccesstoSQL-data.
12) Clause12,“Built-inprocedures”,definesnewbuilt-inproceduresusedinthedefinitionofJava
routinesandtypes.
13) Clause13,“Javatopics”,definesthefacilitiessupportedbyimplementationsofthisdocumentand
theconventionsusedindeploymentdescriptorfiles.
14) Clause14,“InformationSchema”,definesviewedtablesthatcontainschemainformation.
15) Clause15,“DefinitionSchema”,definesbasetablesonwhichtheviewedtablescontainingschema
informationdepend.
16) Clause16,“Statuscodes”,definesSQLSTATEvaluesrelatedtoJavaroutinesandtypes.
17) Clause17,“Conformance”,definesthecriteriaforconformancetothisdocument.
18) AnnexA,“SQLconformancesummary”,isaninformativeAnnex.Itsummarizestheconformance
requirementsoftheSQLlanguage.
19) AnnexB,“Implementation-definedelements”,isaninformativeAnnex.Itliststhosefeaturesfor
whichthebodyofthisdocumentstatesthatthesyntax,themeaning,thereturnedresults,theeffect
onSQL-dataand/orschemas,orotheraspectispartlyorwhollyimplementation-defined.
20) AnnexC,“Implementation-dependentelements”,isaninformativeAnnex.Itliststhosefeaturesfor
whichthebodyofthisdocumentstatesthatthesyntax,themeaning,thereturnedresults,theeffect
onSQL-dataand/orschemas,orotheraspectispartlyorwhollyimplementation-dependent.
21) AnnexD,“SQLoptionalfeaturetaxonomy”,isaninformativeAnnex.Itidentifiestheoptionalfeatures
oftheSQLlanguagespecifiedinthisdocumentbyanidentifierandashortdescriptivename.This
taxonomyisusedtospecifyconformance.
©ISO/IEC2023–Allrightsreserved ix

ISO/IEC9075-13:2023(E)
22) AnnexE,“Deprecatedfeatures”,isaninformativeAnnex.Itlistsfeaturesthattheresponsible
TechnicalCommitteeintendsnottoincludeinafutureeditionofthisdocument.
23) AnnexF,“IncompatibilitieswithISO/IEC9075:2016”,isaninformativeAnnex.Itlistsincompatib-
ilitieswiththepreviouseditionofthisdocument.
24) AnnexG,“DefectReportsnotaddressedinthiseditionofthisdocument”,isaninformativeAnnex.
ItdescribestheDefectReportsthatwereknownatthetimeofpublicationofthisdocument.Each
oftheseproblemsisaproblemcarriedforwardfromthepreviouseditionoftheISO/IEC9075
series.Nonewproblemshavebeencreatedinthedraftingofthiseditionofthisdocument.
Inthetextofthisdocument,Clausesbeginanewodd-numberedpage,andinClause5,“Lexicalelements”,
throughClause17,“Conformance”,Subclausesbeginanewpage.Anyresultingblankspaceisnotsigni-
ficant.
x ©ISO/IEC2023–Allrightsreserved

INTERNATIONAL STANDARD ISO/IEC 9075-13:2023(E)
Informationtechnology—DatabaselanguageSQL—
Part13:
SQLRoutinesandTypesUsingtheJava™ProgrammingLanguage(SQL/JRT)
1 Scope
ThisdocumentspecifiestheabilitytoinvokestaticmethodswrittenintheJava programminglanguage
asSQL-invokedroutinesandtouseclassesdefinedintheJavaprogramminglanguageasSQLstructured
user-definedtypes.
1 Java™isaregisteredtrademarkofOracleCorporationand/oritsaffiliates.
©ISO/IEC2023–Allrightsreserved 1

ISO/IEC9075-13:2023(E)
2 Normativereferences
Thefollowingdocumentsarereferredtointhetextinsuchawaythatsomeoralloftheircontentconsti-
tutesrequirementsofthisdocument.Fordatedreferences,onlytheeditioncitedapplies.Forundated
references,thelatesteditionofthereferenceddocument(includinganyamendments)applies.
ISO/IEC9075-1,Informationtechnology—Databaselanguages—SQL—Part1:Framework
(SQL/Framework)
ISO/IEC9075-2,Informationtechnology—Databaselanguages—SQL—Part2:Foundation
(SQL/Foundation)
ISO/IEC9075-10,Informationtechnology—Databaselanguages—SQL—Part10:ObjectLanguage
Bindings(SQL/OLB)
ISO/IEC9075-11,Informationtechnology—Databaselanguages—SQL—Part11:Informationand
DefinitionSchemas(SQL/Schemata)
JavaCommunityProcess.TheJava™LanguageSpecification[online].JavaSE13Edition.Redwood
Shores,California,USA:Oracle,Availableathttps://docs.oracle.com/javase/specs/jls/-
se13/jls13.pdf
JavaCommunityProcess.TheJava™VirtualMachineSpecification[online].JavaSE13Edition.Redwood
Shores,California,USA:Oracle,Availableathttps://docs.oracle.com/javase/specs/jvms/-
se13/jvms13.pdf
JavaCommunityProcess.Java™ObjectSerializationSpecification[online].RedwoodShores,California,
USA:Oracle,Availableathttps://docs.oracle.com/en/java/javase/13/docs/specs/-
serialization/serial-arch.html
JavaCommunityProcess.JDBC™4.3Specification[online].Edition4.3.RedwoodShores,California,
USA:Oracle,Availableathttps://download.oracle.com/otn-pub/jcp/-
jdbc-4_3-mrel3-eval-spec/jdbc4.3-fr-spec.pdf
2 ©ISO/IEC2023–Allrightsreserved

ISO/IEC9075-13:2023(E)
3 Termsanddefinitions
Forthepurposesofthisdocument,thetermsanddefinitionsgiveninISO/IEC9075-1,ISO/IEC9075-2,
Java,JVMS,andthefollowingapply.
ISOandIECmaintainterminologicaldatabasesforuseinstandardizationatthefollowingaddresses:
— ISOOnlinebrowsingplatform:availableathttps://www.iso.org/obp
— IECElectropedia:availableathttps://www.electropedia.org/
3.1
block
relatedstatementswithinbraces,whichwouldbetreatedasasinglestatement
3.2
classdeclaration
specifiesapossiblyemptysetconsistingofzeroormorefields(3.6),zeroormoremethods,zeroormore
nestedclasses(3.11),zeroormoreinterfaces(3.9),zeroormoreinstanceinitializers(3.7),zeroormore
staticinitializers(3.13),andzeroormoreconstructors
3.3
classfile
filecontainingJavabytecode
3.4
classinstance
consistsofaninstanceofeachinstancevariable(3.8)declaredintheclassandeachinstancevariable(3.8)
declaredinthesuperclassesoftheclass
3.5
classvariable
staticvariabledeclaredinaclass
3.6
field
classvariables(3.5)andinstancevariables(3.8)ofaclass
3.7
instanceinitializer
blockthatisusedtoinitializetheinstancedatamember,thatrunseachtimewhenobjectoftheclassis
created
3.8
instancevariable
variablethatisdeclaredinsideaclassbutoutsidethescopeofanymethod
3.9
interface
Javaconstructconsistingofasetofmethodsignatures
3.10
localvariable
variablesdeclaredinsidethebodyofamethod
©ISO/IEC2023–Allrightsreserved 3

ISO/IEC9075-13:2023(E)
3 Termsanddefinitions
3.11
nestedclass
classwithinanotherclass
3.12
package
zeroormoreclasses,zeroormoreinterfaces(3.9),andzeroormoresubpackages(3.14)
3.13
staticinitializer
executescodebeforetheobjectinitialization
3.14
subpackage
package(3.12)withinapackage(3.12)
3.15
JVM
JavaVirtualMachine
virtualmachinethatenablesacomputertorunJavaprograms
3.16
defaultconnection
JDBCconnectiontothecurrentSQL-implementation,SQL-session,andSQL-transactionestablishedwith
thedatasourceURL'jdbc:default:connection'
Note1toentry:SeeRFC2368andRFC3986formoredetailsaboutURLs.
3.17
deploymentdescriptor
oneormoreSQL-statementsthatspecifyandtobetaken,respectively,
bytheSQLJ.INSTALL_JARandSQLJ.REMOVE_JARproceduresandthatarecontainedina
deploymentdescriptorfile(3.18)
3.18
deploymentdescriptorfile
textfilecontainingdeploymentdescriptors(3.17)thatiscontainedinaJAR(3.22),forwhichtheJAR’s
manifestentry,asdescribedbythejava.util.jarsectionofJVMS,specifiesSQLJDeploymentDescriptor:
TRUE
3.19
externalJavadatatype
SQLuser-definedtypedefinedwithathatspecifiesan clause>
3.20
externalJavaroutine
externalroutinedefinedwithanthatspecifiesLANGUAGEJAVAandeither
PROCEDUREorFUNCTION,ordefinedwithathatspecifiesan Javatypeclause>
3.21
installedJAR
JAR(3.22)whoseexistencehasbeenregisteredwiththeSQL-environmentandwhosecontentshave
beencopiedintothatSQL-environmentduetoexecutionofoneoftheproceduresSQLJ.INSTALL_JAR
andSQLJ.REPLACE_JAR
4 ©ISO/IEC2023–Allrightsreserved

ISO/IEC9075-13:2023(E)
3 Termsanddefinitions
3.22
JAR
JavaArchive
zip-formattedfile,asdescribedbythejava.util.zipsectionofJVMS,containingzeroormoreJava
classandserfiles,andzeroormoredeploymentdescriptorfiles
Note1toentry:JARsareanormalvehiclefordistributingJavaprogramsandthemechanismspecified
bythisdocumenttoprovidetheimplementationofexternalJavaroutinesandexternalJavadatatypes
toanSQL-environment.
3.23
serfile
filecontainingrepresentationsofJavaobjectsintheformdefinedinJavaSerialization
3.24
subjectJavaclass
Javaclassuniquelyidentifiedbythecombinationoftheclass’ssubjectJavaclassname(3.25)andits
containingJAR(3.22)
3.25
subjectJavaclassname
fully-qualifiedpackagenameandclassnameofaJavaclass
3.26
systemclass
Javaclassprovidedbyaconformingimplementationofthisdocumentthatcanbereferencedbyan
externalJavaroutineoranexternalJavadatatypewithoutthatclasshavingbeenincludedinaninstalled
JAR(3.22)
©ISO/IEC2023–Allrightsreserved 5

ISO/IEC9075-13:2023(E)
4 Concepts
ThisClausemodifiesClause4,“Concepts”,inISO/IEC9075-2.
4.1 Notationsandconventions
ThisSubclausemodifiesSubclause4.1,“Notationsandconventions”,inISO/IEC9075-2.
4.1.1 Notations
ThisSubclausemodifiesSubclause4.1.1,“Notations”,inISO/IEC9075-2.
ThenotationsusedinthisdocumentaredefinedinISO/IEC9075-1.
ThesyntaxdefinedinthisdocumentisavailablefromtheISOwebsiteasa“digitalartifact”.See
https://standards.iso.org/iso-iec/9075/-13/ed-5/en/todownloaddigitalartifactsfor
thisdocument.Todownloadthesyntaxdefinedinaplain-textformat,selectthefilenamed
ISO_IEC_9075-13(E)_JRT.bnf.txt.TodownloadthesyntaxdefinedinanXMLformat,selectthe
filenamedISO_IEC_9075-13(E)_JRT.bnf.xml.
4.1.2 Specificationofbuilt-inprocedures
Built-inproceduresarespecifiedintermsofthefollowinginformation.
— Function:Ashortstatementofthepurposeoftheprocedure.
— Signature:Aspecification,inSQL,ofthesignatureoftheprocedure.Theonlypurposeofthesigna-
tureistospecifytheprocedurename,parameternames,andparametertypes.Themannerinwhich
thesebuilt-inproceduresaredefinedisimplementation-dependent(UW004).
— AccessRules:AspecificationinEnglishofrulesgoverningtheaccessibilityofschemaobjectsthat
shallholdbeforetheGeneralRulesmaybesuccessfullyapplied.
— GeneralRules:AspecificationinEnglishoftherun-timeeffectofinvocationoftheprocedure.
WheremorethanoneGeneralRuleisusedtospecifytheeffectofanelement,therequiredeffect
isthatwhichwouldbeobtainedbybeginningwiththefirstGeneralRuleandapplyingtheRulesin
numericsequenceunlessaRuleisappliedthatspecifiesorimpliesachangeinsequenceortermin-
ationoftheapplicationoftheRules.UnlessotherwisespecifiedorimpliedbyaspecificRulethat
isapplied,applicationofGeneralRulesterminateswhenthelastinthesequencehasbeenapplied.
— ConformanceRules:Aspecificationofhowtheelementshallbesupportedforconformanceto
SQL.
ThescopeofnotationalsymbolsistheSubclauseinwhichthosesymbolsaredefined.WithinaSubclause,
thesymbolsdefinedintheSignature,AccessRules,orGeneralRulescanbereferencedinotherrules
providedthattheyaredefinedbeforebeingreferenced.
4.1.3 Specificationofdeploymentdescriptorfiles
Deploymentdescriptorfilesarespecifiedintermsofthefollowing.
— Function:Ashortstatementofthepurposeofthedeploymentdescriptorfile.
— Model:Abriefdescriptionofthemannerinwhichadeploymentdescriptorfileisidentifiedwithin
itscontainingJAR.
6 ©ISO/IEC2023–Allrightsreserved

ISO/IEC9075-13:2023(E)
4.1 Notationsandconventions
— Properties:ABNFspecificationofthesyntaxofthecontentsofadeploymentdescriptorfile.
— Description:Aspecificationoftherequirementsandrestrictionsonthecontentsofadeployment
descriptorfile.
— ConformanceRules:Aspecificationofhowtheelementshallbesupportedforconformanceto
SQL.
4.2 Javaprogramminglanguage
TheJavaprogramminglanguageisaclass-based,object-orientedlanguage.Thisdocumentusesthefol-
lowingJavaconceptsandterminology.
AclassisthebasicconstructofJavaprograms,inthatallexecutableJavacodeiscontainedinaJavaclass
definition.Aclassisdeclaredbyaclassdeclarationthatspecifiesapossiblyemptysetconsistingofzero
ormorefields,zeroormoremethods,zeroormorenestedclasses,zeroormoreinterfaces,zeroormore
instanceinitializers,zeroormorestaticinitializers,andzeroormoreconstructors.
Thescopeofavariableisaclass,aninstanceoftheclass,oramethodoftheclass.Thescopeofavariable
thatisdeclaredstaticistheclass,andthevariableiscalledaclassvariable.Thescopeofeachothervariable
declaredintheclassisinstancesoftheclass,andsuchavariableiscalledaninstancevariable.Class
variablesandinstancevariablesofaclassarecalledfieldsofthatclass.Thescopeofavariabledeclared
inamethodistheblockorJavaforstatementinwhichitisdeclaredinthatmethod,andthevariableis
calledalocalvariable.
Aclassinstanceconsistsofaninstanceofeachinstancevariabledeclaredintheclassandeachinstance
variabledeclaredinthesuperclassesoftheclass.Classinstancesarestronglytypedbytheclassname.
Theoperationsavailableonaclassinstancearethosedefinedforitsclass.
Withtheexceptionoftheclassjava.lang.Object,eachclassisdeclaredtoextend(atmost)oneother
class;aclassnotexplicitlydeclaredtoextendanotherclassimplicitlyextendsjava.lang.Object.The
declaredclassisadirectsubclassoftheclassthatitextends;theclassthatitextendsisthedirectsuperclass
ofthedeclaredclass.
ClassBisasubclassofclassAifBisadirectsubclassofA,orifthereexistssomeclassCsuchthatBisa
directsubclassofCandCisasubclassofA.Likewise,classBisasuperclassofclassAifBisadirect
superclassofA,orifthereexistssomeclassCsuchthatBisadirectsuperclassofCandCisasuperclass
ofA.AsubclasshasallofthefieldsandmethodsofitssuperclassesandaninstanceofclassBmaybe
usedwhereveraninstanceofasuperclassofBispermitted.
Amethodisanexecutableroutine.Amethodcanbedeclaredstatic,inwhichcaseitiscalledaclassmethod;
otherwise,itiscalledaninstancemethod.Aclassmethodcanbereferencedbyqualifyingthemethod
namewitheithertheclassnameorthenameofaninstanceoftheclass.Aninstancemethodisreferenced
byqualifyingthemethodnamewithaJavaexpressionthatresultsinaninstanceoftheclassor,inthe
caseofaconstructor,with“new”.Themethodbodyofaninstancemethodcanreferenceitsclassvariables,
instancevariables,andlocalvariables.
TheJavamethodsignatureofamethodconsistsofthemethodnameandthenumberofparametersand
theirdatatypes.
Apackageconsistsofzeroormoreclasses,zeroormoreinterfaces,andzeroormoresubpackages(a
subpackageisapackagewithinapackage);eachpackageprovidesitsownnamespaceandclasseswithin
apackageareabletorefertootherclassesinthesamepackage,includingclassesnotreferenceablefrom
outsidethepackage.Everyclassbelongstoexactlyonepackage,eitheranexplicitlyspecifiednamed
packageortheanonymousdefaultpackage.AclasscanspecifyJavaimportstatementstorefertoother
namedpackageswhoseclassescanthenbereferencedwithintheclasswithoutpackagequalification.
Aclass,field,ormethodscanbedeclaredaspublic,private,orprotected.Apublicvariableormethodcan
beaccessedbyanymethod.Aprivatevariableormethodcanonlybereferencedbymethodsinthesame
©ISO/IEC2023–Allrightsreserved 7

ISO/IEC9075-13:2023(E)
4.2 Javaprogramminglanguage
class.Aprotectedvariableormethodcanonlybereferencedbymethodsofthesameclassorsubclasses
thereof.Amethodthatisnotdeclaredaspublic,private,orprotectedcanonlybecalledbymethods
declaredbyclassesinthesamepackage.
AninterfaceisaJavaconstructconsistingofasetofmethodsignatures.Aninterfacecanbeimplemented
byzeroormoreclasses,aclasscanbedeclaredtoimplementzeroormoreinterfaces,andaclassis
requiredtohavemethodswiththesignaturesspecifiedbyallofitsdeclaredinterfaces.
TheJavaSerializableinterface,java.io.Serializable,asdescribedinJVMS,definesatransformation
betweenaJavainstanceandajava.io.OutputStreamorjava.io.InputStream,asdefinedbythe
java.io.OutputStreamandjava.io.InputStreamsectionsofJVMSrespectively,writingapersistent
representationofaninstanceofaJavaobjectandreadingapersistentrepresentationofaninstanceof
aJavaobject.Thistransformationretainssufficientinformationtoidentifythemostspecificclassofthe
instanceandtoreconstructtheinstance.
TheJavaSQLDatainterface,java.sql.SQLData,asdescribedinJDBCandJVMS,definesatransformation
betweenaJavainstanceandanSQLuser-defineddatatype.
ThesourceforaJavaclassisnormallystoredinaJavafilewiththefile-type“java”,e.g.,myclass.java.
JavaisnormallycompiledtoabytecodedinstructionsetthatisportabletoanyplatformsupportingJava.
Afilecontainingsuchbytecodeisnormallystoredinaclassfilewiththefile-type“class”,e.g.,myc-
lass.class.
AsetofclassfilescanbeassembledintoaJavaarchivefile,orJAR(usuallywithafileextensionof“.jar”.
AJARisazipformattedfilecontainingasetofJavaclassfiles.JARsarethenormalvehiclefordistributing
Javaprograms.
4.3 SQL-invokedroutines
ThisSubclausemodifiesSubclause4.35,“SQL-invokedroutines”,inISO/IEC9075-2.
4.3.1 CharacteristicsofSQL-invokedroutines
ThisSubclausemodifiesSubclause4.35.2,“CharacteristicsofSQL-invokedroutines”,inISO/IEC9075-2.
Insertafterthe2ndparagraph: Externalroutinesappearintwoseeminglysimilar,butfundamentally
differing,forms,wherethekeydifferentiatoriswhetherornottheexternalroutine’sroutinedescriptor
specifiesthatthebodyoftheSQL-invokedroutineiswritteninJava.WhenthebodyoftheSQL-invoked
routineiswritteninJava,theexternalroutineisanexternalJavaroutine;somedifferencesfromother
externalroutinesincludethefollowingitems.
— Foranyotherexternalroutine,theexecutableform(suchasadynamiclinklibraryorsomerun-
timeinterpretedform)ofthatroutineexistsexternallytotheSQL-environment’scatalogs;foran
externalJavaroutine,theexecutableformisprovidedbyaspecifiedsubjectJavaroutinethatexists
intheSQL-environment’scatalogsinaninstalledJAR.
— BecauseaninstalledJARisnotrequiredtobecompletelyself-contained(i.e.,tohavenoreferences
toJavaclassesoutsideofitself),amechanismisprovidedtoallowasubjectJavaclasstoreference
classesdefinedbyclassfilescontainedinitsinstalledJARorinotherinstalledJARs.SeeSubclause9.3,
“”.
NOTE1—OnceanexternalJavaroutinehasbeencreated,itsuseinSQLstatementsexecutedbythecontainingSQL-
environmentissimilartothatofotherexternalroutines.
Insertintothe8thparagraph,afterthelastlistitem:
— IftheinstanceSQL-invokedmethodisanexternalJavaroutine,theterm“setofoverridingmethods”
isnotapplicable;forsuchmethods,thecapabilitiesprovidedbyoverridingmethodsduplicateJava’s
ownmechanismsandthesubjectroutineexecutedistheonethatwouldbeinvokedwhenno
overridingmethodsarespecified.
8 ©ISO/IEC2023–Allrightsreserved

ISO/IEC9075-13:2023(E)
4.3 SQL-invokedroutines
Augmentthe15thparagraph byadding“WhentheSQL-invokedroutineisnotanexternalJavaroutine,”
asarestrictiontothebeginningoftheRule.
Insertafterthe15thparagraph: WhentheSQL-invokedroutineisanexternalJavaroutine,valuesin
theeffectiveSQLparameterlistarepassedtotheprogramidentifiedbyaccordingtothe
rulesofSubclause4.6,“Parametermapping”.
4.4 Javaclassnameresolution
TypicalJVMsprovideaclassnameresolution,orsearchpath,mechanismbasedonanenvironmental
variablecalledCLASSPATH.WhenaJVMencountersapreviouslyunseenreferencetoaclass,themembers
ofthelistofdirectoriesandJARsappearingintheclasspathareexaminedinorderuntileithertheclass
isfoundortheendofthelistisreached.Failuretolocateareferencedclassisaruntimeerrorthatwill
oftencausetheapplicationthatexperiencesittoterminate.
WhenJARsappearintheCLASSPATH,anabilityexistsforfurthereffectiveextensionofthatCLASSPATH.
AdditionalJARswillbeincludedintheclassresolutionprocesswhenaJARintheCLASSPATHhasa
manifestspecifyingoneormoreClass-Pathattributes.AClass-PathattributeprovidesrelativeURLs
ofadditionalJARs.TheseClass-PathattributeURLsarerelativetothesource,forexample,thedirectory,
containingtheJARwhosemanifestisthenbeingprocessed.AfullURL,forexampleafile:/orhttp://
formatURL,isnotallowedinaClass-Pathattribute.TheJARsenumeratedbyClass-Pathattributes
extendtheCLASSPATH.
WhenaJVMistransitionedtobeingeffectivelywithinanSQL-environment,theproblemofmanaging
theJVM’sclassnameresolutioncontinuestoexist,butwithachangeinemphasis.Oneimportantchange
isthataninstalledJARmanifest’sClass-Pathattributescannotbehonored.NorelativeURLhasmeaning
whenthesourceofthecurrentJARisgivenbya,,and id>.ToallowthecreatorsofJavaapplicationsagreaterdegreeofcontroloverclassnameresolution,and
theaddedsecurityassociatedwiththatcontrol,aClass-Pathattribute-likemechanismisdefinedtobe
apropertyoftheJARscontainingtheJavaapplications,ratherthanasanenvironmentalvariableofthe
currentsession(suchas,forexample,CURRENT_PATHfordynamicstatements).Thismechanism,referred
toasaJAR’sSQL-Javapath,providesameansforownersofinstalledJARstocontroltheclassresolution
processthattheCLASSPATHandClass-PathattributesgiveusersandcreatorsofJARsoutsideanSQL-
environment.But,notethatthesetwomechanismsareonlysimilar,theyarenotidentical.If,whilean
externalJavaroutineisbeingexecuted,apreviouslyunseenclassreferenceisencountered,thatclassis
searchedforintheJARcontainingthedefinitionofthecurrentlyexecutingclass,and,ifitisnotfound,
theclasswillbesoughtinthemannerspecifiedbytheSQL-JavapathassociatedwiththatJAR(ifany).
AnSQL-JavapathspecifieshowaJVMresolvesaclassnamewhenaclasswithinaJARreferencesaclass
thatisnotasystemclassornotinthesameJAR.SQLJ.ALTER_JAVA_PATHisusedtoassociatedanSQL-
JavapathwithaJAR.AnSQL-Javapathisalistof(referenceditem,referencedJAR)pairs.Areferenced
itemcanbeeitheraclass,apackage,or'*'tospecifytheentireJAR.TheSQL-Javapathlistissearchedin
theorderthepairsarespecified.Foreach(referenceditem,referencedJAR)pair(RI,RJ),thefollowing
stepsaretaken.
— IfRIistheclassname,thentheclassshallbedefinedinRJ.Ifitisnot,anexceptionconditionis
raised.
— IfRIisthepackageoftheclassbeingresolved,thentheclassshallbedefinedinRJ.Ifitisnot,an
exceptionconditionisraised.
— IfRIis'*'andtheclassisdefinedinRJ,thenthatresolutionisused;otherwise,subsequentpairs
aretested.
©ISO/IEC2023–Allrightsreserved 9

ISO/IEC9075-13:2023(E)
4.5 SQLresultsets
4.5 SQLresultsets
Cursors,orSQLresultsets,appeartoJavaapplicationsintwoforms;thefirst,asanobjectofaclassthat
implementstheinterfacejava.sql.ResultSetasdefinedinJDBCandJVMS,referredtoasaJDBCResultSet;
thesecond,asanobjectofaclassthatimplementstheinterfacesqlj.runtime.ResultSetIteratoras
definedbyISO/IEC9075-10,referredtoasanSQLJIterator.
InISO/IEC9075-2,SQL-invokedproceduresaredeclaredtobeabletoreturnzeroormoredynamic
resultsets,referredtoasresultsetcursors.Tobeareturnedresultsetcursor,acursor’sdeclarationshall
specifyWITHRETURN,andthecursorshallbeopenatthepointthattheSQL-invokedprocedureexits.
WhileexternalJavaroutinesthatareSQL-invokedprocedurescanlikewisebedeclaredtoreturnzero
ormoredynamicresultsets,insomeotherrespects,thisdocument’streatmentofresultsetcursorsdiffers
fromthatofISO/IEC9075-2.
InaJavaapplication,allJDBCResultSetsandSQLJIteratorsareimplicitlyresultsetcursors,thatis,their
underlyingcursordeclarationsimplicitlyspecifyWITHRETURN.So,inthisdocument,toactuallybea
returnedresultsetcursoritisnotsufficientthatthecorrespondingJDBCResultSet’sorSQLJIterator’s
underlyingcursorbeopenwhentheSQL-invokedprocedureexits;theJDBCResultSetorSQLJIterator
shallalsohavebeenexplicitlyassignedtoaparameterofthesubjectJavaroutinethatrepresentsan
outputparameter.AsdiscussedinSubclause4.6,“Parametermapping”,andSubclause8.1,“Invokingan
SQL-invokedroutine”,outputparametersarerepresentedtoasubjectJavaroutineasthefirstelement
ofaonedimensionalarrayofaJavadatatypethatcanbemappedtoanSQLdatatype.Fordynamicresult
sets,thearrayshallbeofaclassthatimplementstheinterfacejava.sql.ResultSetortheinterface
sqlj.runtime.ResultSetIterator,theJDBCResultSetorSQLJIteratorshallhavebeenexplicitlyassigned
tothefirstelementofthatarray,andthatJDBCResultSetorSQLJIteratorshallnothavebeenclosed.
Itisimportanttonotethatthisdifferenceinhowaresultsetcursorbecomesareturnedresultsetcursor
isinvisibletothecallingapplication.AsdescribedinSubclause8.1,“InvokinganSQL-invokedroutine”,
thecallingapplicationwillbereturnedzeroormoredynamicresultsetsintheorderinwhichthecursors
wereopened,justasinISO/IEC9075-2;theorderoftheparametersinthesubjectJavaroutinedoesnot
impacttheorderinwhichthecallingapplicationaccessesthereturnedresultsets.
4.6 Parametermapping
LetSTbesomeSQLdatatypeandletJTbesomeJavadatatype.
STandJTaresimplymappableifandonlyifSTandJTarespecifiedrespectivelyinthefirstandsecond
columnsofsomerowoftheDatatypeconversiontables,TableB.1,entitled“JDBCTypesmappedtoJava
Types”,inJDBC.TheJavadatatypeJTisthecorrespondingJavadatatypeofST.
STandJTareobjectmappableifandonlyifSTandJTarespecifiedrespectivelyinthefirstandsecond
columnsofsomerowoftheDatatypeconversiontables,TableB.3,entitled“MappingfromJDBCTypes
toJavaObjectTypes”,inJDBC,orifthedescriptorofSTspecifiesthatitisanexternalJavadatatypeand
thedescriptorspecifiesJTastheinthe.
STandJTareoutputmappableifandonlyifexactlyoneofthefollowingistrue.
— JTisaonedimensionalarraytypewithanelementdatatypeJT2(thatis,JTis“JT2[]”)andSTis
eithersimplymappabletoJT2orobjectmappabletoJT2.
— JTisjava.lang.StringBufferanditscorrespondingparameterintheaugmentedSQLparameter
declarationlististhesaveareadataitem.
AnSQLarraytypewithanelementdatatypeSTandJTarearraymappableifandonlyifJTisaone
dimensionalarraytypewithanelementdatatypeJT2andSTiseithersimplymappabletoJT2orobject
mappabletoJT2.
10 ©ISO/IEC2023–Allrightsreserved

ISO/IEC9075-13:2023(E)
4.6 Parametermapping
STandJTaremappableifandonlyifSTandJTaresimplymappable,objectmappable,outputmappable,
orarraymappable.
AJavadatatypeismappableifandonlyifitismappabletosomeSQLdatatype.
AJavaclassisresultsetorientedifandonlyifitiseitherofthefollowing.
— AclassthatimplementstheJavainterfacejava.sql.ResultSet.
— AclassthatimplementstheJavainterfacesqlj.runtime.ResultSetIterator.
NOTE2—Theseclassesaregeneratedbyiteratordeclarations(#sql iterator)asspecifiedinISO/IEC9075-10.
AJavadatatypeisresultsetmappableifandonlyifitisaone-dimensionalarraytypewithanelement
typethatisaresultsetorientedclass.
AJavamethodwithMparametersismappable(toSQL)ifandonlyif,forsomeN,0(zero)≤N≤M,the
datatypesofthefirstNparametersaremappable,thelastM−Nparametersareresultsetmappable,and
theresulttypeiseithersimplymappable,objectmappable,orvoid.
AJavamethodisvisibleinSQLifandonlyifitispublicandmappable.Inaddition,tobevisible,aJava
methodshallbestaticifusedastheexternalJavaroutineofanSQL-invokedprocedureoranSQL-invoked
regularfunction.
AJavaclassisvisibleinSQLifandonlyifitispublicandmappable.
JDBCcontainsJDBC’sSQLtoJavadatatypemappingsdefinedintheJDBCtypemappingtables.IfSTis
anexternalJavadatatypethatappearsintheINFORMATION_SCHEMA.USER_DEFINED_TYPESview,then
letJTbeST’sdescriptor’sinits.JDBC’sdatatypemappingtables
areeffectivelyextended.Arow(ST,JT)isconsideredtobeanadditionalrowinTableB.3,Mappingfrom
JDBCTypestoJavaObjectTypes,andarow(JT,ST)isconsideredtobeanadditionalrowinTableB.4,
MappingfromJavaObjectTypestoJDBCTypes(bothtablesappearinJDBC).
4.7 UnhandledJavaexceptions
JavaexceptionsthatarethrownduringexecutionofaJavamethodinSQLcanbecaught,orhandled,
withinJava;ifthisisdone,thenthoseexceptionsdonotaffectSQLprocessing.AllJavaexceptionsthat
areuncaughtwhenaJavamethodcalledfromSQLcompletesappearintheSQL-environmentasSQL
exceptionconditions.
ThemessagetextmaybespecifiedintheJavaexceptionspecifiedintheJavathrowstatement.IftheJava
exceptionisaninstanceofjava.sql.
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...