ISO/IEC 9075-10:2023
(Main)Information technology — Database languages SQL — Part 10: Object language bindings (SQL/OLB)
Information technology — Database languages SQL — Part 10: Object language bindings (SQL/OLB)
ISO/IEC 9075-2 specifies embedded SQL for the programming languages: Ada, C, COBOL, Fortran, MUMPS, Pascal, and PL/I. ISO/IEC 9075-10:2016 defines similar features of Database language SQL that support embedding of SQL-statements into programs written in the Java? programming language (Java is a registered trademark of Sun Microsystems, Inc.). The embedding of SQL into Java is commonly known as "SQLJ". This part of ISO/IEC 9075 specifies the syntax and semantics of SQLJ, as well as mechanisms to ensure binary portability of resulting SQLJ applications. In addition, it specifies a number of Java packages and their contained classes (including methods). Throughout ISO/IEC 9075-10:2016, the terms "SQLJ" and "SQL/OLB" are used synonymously. NOTE Additional explanatory material (non-normative) about certain facilities defined in ISO/IEC 9075-2 can be found in ISO/IEC TR 19075-3.
Technologies de l'information — Langages de base de données SQL — Partie 10: Liaisons de langage objet (SQL/OLB)
General Information
Relations
Standards Content (Sample)
INTERNATIONAL ISO/IEC
STANDARD 9075-10
Fifth edition
2023-06
Information technology — Database
languages SQL —
Part 10:
Object language bindings (SQL/OLB)
Technologies de l'information — Langages de base de données
SQL —
Partie 10: Liaisons de langage objet (SQL/OLB)
Reference number
ISO/IEC 9075-10:2023(E)
© ISO/IEC 2023
---------------------- Page: 1 ----------------------
ISO/IEC 9075-10:2023(E)
COPYRIGHT PROTECTED DOCUMENT
© 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
---------------------- Page: 2 ----------------------
ISO/IEC9075-10:2023(E)
Contents Page
Foreword.xviii
Introduction.xx
1 Scope.1
2 Normativereferences.2
3 Termsanddefinitions.3
4 Concepts.6
4.1 Notationsandconventions.6
4.1.1 Notations.6
4.1.2 Firsttermusage.6
4.1.3 Java-related conventions.6
4.1.4 Specificationoftranslator-generatedclasses.7
4.2 Characterstrings.8
4.2.1 Unicode support.8
4.3 Embedded syntax.8
4.4 IntroductiontoSQLJ.8
4.4.1 Overview.8
4.4.2 SQLconstructs.9
4.4.3 SQLJclauses.9
4.4.4 Binaryportability.10
4.4.4.1 Binaryportabilityrequirements.10
4.4.4.2 Componentsofbinaryportableapplications.11
4.4.5 Profile overview.11
4.4.5.1 Introductiontoprofiles.11
4.4.5.2 EntryInfooverview.12
4.4.5.3 TypeInfo overview.14
4.4.5.4 SQLJdatatypeproperties.16
4.4.6 Host variables.18
4.4.7 Hostexpressions.18
4.4.8 Connectioncontexts.18
4.4.9 Defaultconnectioncontext.18
4.4.10 Schemacheckingusingexemplarschemas.19
4.4.11 UsingmultipleSQLJcontextsandconnections.19
4.4.12 DynamicSQLandJDBC/SQLJConnectioninteroperability.20
4.4.12.1 Introductiontoconnectioninteroperability.20
4.4.12.2 CreatinganSQLJConnectionContextfromajava.sql.Connectionobject.20
4.4.12.3 Obtainingajava.sql.ConnectionobjectfromanSQLJConnectionContext.20
4.4.12.4 Connectionsharing.20
4.4.12.5 Connectionresourcemanagement.20
©ISO/IEC2023–Allrightsreserved iii
---------------------- Page: 3 ----------------------
ISO/IEC9075-10:2023(E)
4.4.13 SQLexecutioncontrolandstatus.21
4.4.14 Iterators.21
4.4.15 Inputandoutputassignability.22
4.4.16 Multiplejava.sql.ResultSetobjectsfromSQL-invokedprocedurecalls.36
4.4.16.1 Introductiontomultipleresultsets.36
4.4.16.2 Resourcemanagementwithmultipleresults.36
4.4.17 JDBC/SQLJResultSetinteroperability.36
4.4.17.1 Introductiontointeroperability.36
4.4.17.2 CreatinganSQLJiteratorfromajava.sql.ResultSetobject.36
4.4.17.3 Obtainingajava.sql.ResultSetobjectfromanSQLJiteratorobject.37
4.4.17.4 Obtainingajava.sql.ResultSetobjectfromanuntypediteratorobject.37
4.4.17.5 Iteratorandjava.sql.ResultSetobjectresourcemanagement.37
4.4.18 Multi-threadingconsiderations.38
4.4.19 User-defineddatatypes.38
4.4.20 Batch updates.39
4.4.20.1 Introductiontobatchupdates.39
4.4.20.2 Batchablestatementsandbatchcompatibility.39
4.4.20.3 StatementbatchingAPI.39
4.4.20.4 Executionstatusandupdatecounts.40
4.4.20.5 Programsemanticsandexceptions.40
4.4.20.6 Batchcancellationanddisabling.41
4.4.20.7 Specificationofabatchinglimit.41
4.4.21 SQLJlanguageelements.42
4.4.21.1 IntroductiontoSQLJlanguageelements.42
4.4.21.2 .42
4.4.21.3 SQL-schema,SQL-data,andSQL-transactionstatements.43
4.4.21.4 .43
4.4.21.5 .43
4.4.21.6 .43
4.4.21.7 .43
4.4.21.8 .44
4.4.21.9 Cursor declaration.44
4.4.21.10 InputparameterstoSQL-statements.44
4.4.21.11 ExtractingcolumnvaluesfromSQLJiterators.44
4.4.21.12 andcursors.44
4.4.22 SQLJ,JDBC,andSQLExceptionsandSQLWarnings.45
4.4.23 Profilegenerationandnaming.45
4.4.24 SQLJapplicationpackaging.46
4.4.25 Profilecustomizerinterface.46
4.4.26 Customizationinterface.47
4.4.26.1 Introductiontocustomizationinterfaces.47
4.4.26.2 Customization usage.47
4.4.26.3 Customization registration.48
5 Lexicalelements.50
5.1 .50
5.2 and.51
6 Scalarexpressions.52
iv ©ISO/IEC2023–Allrightsreserved
---------------------- Page: 4 ----------------------
ISO/IEC9075-10:2023(E)
6.1 and.52
7 Additionalcommonrules.53
7.1 InvokinganSQL-invokedroutine.53
8 Datamanipulation.54
8.1 .54
8.2 .57
8.3 .61
8.4 .63
9 Control statements.65
9.1 .65
9.2 .67
9.3 .69
10 Transactionmanagement.71
10.1 .71
10.2 .72
10.3 .73
10.4 .74
10.5 .75
11 Embedded SQL.76
11.1 .76
11.2 .78
12 SQLJreservednames.79
12.1 Introductiontoreservednames.79
12.2 Namingruntimelibrarycomponents.79
12.3 Temporaryvariablenames.79
12.4 Classandresourcefilenames.79
12.4.1 Introduction.79
12.4.2 Generated classes.79
12.4.3 Resourcefilesandprofiles.80
13 Commonsubelements.81
13.1 .81
13.2 .82
13.3 .83
13.4 .84
13.5 .85
13.6 .86
13.7 .89
13.8 .90
14 andcontents.93
14.1 .93
14.2 .94
14.3 Generatedconnectionclass.95
14.4 .100
14.5 .102
14.6 Generatedpositionediteratorclass.103
©ISO/IEC2023–Allrightsreserved v
---------------------- Page: 5 ----------------------
ISO/IEC9075-10:2023(E)
14.7 .105
14.8 Generatednamediteratorclass.106
14.9 .108
14.10 .114
14.11 .115
14.12 .116
14.13 .118
14.14 .122
14.15 .124
15 Packagesqlj.runtime.127
15.1 Overview.127
15.2 SQLJruntimeinterfaces.127
15.2.1 sqlj.runtime.ConnectionContext.127
15.2.1.1 Interfaceoverview.127
15.2.1.2 Variables.128
15.2.1.2.1 CLOSE_CONNECTION.128
15.2.1.2.2 KEEP_CONNECTION.128
15.2.1.3 Methods.128
15.2.1.3.1 close ().128
15.2.1.3.2 close (boolean).129
15.2.1.3.3 getConnectedProfile(Object).129
15.2.1.3.4 getConnection ().130
15.2.1.3.5 getExecutionContext().130
15.2.1.3.6 getTypeMap().130
15.2.1.3.7 isClosed().131
15.2.2 sqlj.runtime.ForUpdate.131
15.2.2.1 Interfaceoverview.131
15.2.2.2 Methods.131
15.2.2.2.1 getCursorName ().131
15.2.3 sqlj.runtime.NamedIterator.131
15.2.4 sqlj.runtime.PositionedIterator.132
15.2.4.1 Interfaceoverview.132
15.2.4.2 Methods.132
15.2.4.2.1 endFetch().132
15.2.5 sqlj.runtime.ResultSetIterator.133
15.2.5.1 Interfaceoverview.133
15.2.5.2 Variables.133
15.2.5.2.1 ASENSITIVE.133
15.2.5.2.2 FETCH_FORWARD.133
15.2.5.2.3 FETCH_REVERSE.133
15.2.5.2.4 FETCH_UNKNOWN.133
15.2.5.2.5 INSENSITIVE.133
15.2.5.2.6 SENSITIVE.134
15.2.5.3 Methods.134
15.2.5.3.1 Noteaboutmethods.134
15.2.5.3.2 clearWarnings ().134
15.2.5.3.3 close ().134
vi ©ISO/IEC2023–Allrightsreserved
---------------------- Page: 6 ----------------------
ISO/IEC9075-10:2023(E)
15.2.5.3.4 getFetchSize().134
15.2.5.3.5 getResultSet().135
15.2.5.3.6 getRow ().135
15.2.5.3.7 getSensitivity().135
15.2.5.3.8 getWarnings().136
15.2.5.3.9 isClosed().136
15.2.5.3.10 next().137
15.2.5.3.11 setFetchSize(int).137
15.2.6 sqlj.runtime.Scrollable.138
15.2.6.1 Interfaceoverview.138
15.2.6.2 Variables.138
15.2.6.3 Methods.138
15.2.6.3.1 absolute(int).138
15.2.6.3.2 afterLast().138
15.2.6.3.3 beforeFirst ().138
15.2.6.3.4 first ().139
15.2.6.3.5 getFetchDirection ().139
15.2.6.3.6 isAfterLast ().139
15.2.6.3.7 isBeforeFirst().140
15.2.6.3.8 isFirst ().140
15.2.6.3.9 isLast().140
15.2.6.3.10 last().140
15.2.6.3.11 previous ().141
15.2.6.3.12 relative(int).141
15.2.6.3.13 setFetchDirection (int).141
15.3 SQLJruntimeclasses.143
15.3.1 sqlj.runtime.AsciiStream.143
15.3.1.1 Class overview.143
15.3.1.2 Constructors.143
15.3.1.2.1 AsciiStream(InputStream).143
15.3.1.2.2 AsciiStream(InputStream,int).143
15.3.2 sqlj.runtime.BinaryStream.144
15.3.2.1 Class overview.144
15.3.2.2 Constructors.144
15.3.2.2.1 BinaryStream (InputStream).144
15.3.2.2.2 BinaryStream(InputStream,int).144
15.3.3 sqlj.runtime.DefaultRuntime.145
15.3.3.1 Class overview.145
15.3.3.2 Constructors.145
15.3.3.2.1 DefaultRuntime ().145
15.3.3.3 Methods.145
15.3.3.3.1 getDefaultConnection ().145
15.3.3.3.2 getLoaderForClass (Class).145
15.3.4 sqlj.runtime.ExecutionContext.146
15.3.4.1 Class overview.146
15.3.4.2 Variables.147
15.3.4.2.1 ADD_BATCH_COUNT.147
©ISO/IEC2023–Allrightsreserved vii
---------------------- Page: 7 ----------------------
ISO/IEC9075-10:2023(E)
15.3.4.2.2 AUTO_BATCH.147
15.3.4.2.3 EXEC_BATCH_COUNT.147
15.3.4.2.4 EXCEPTION_COUNT.147
15.3.4.2.5 NEW_BATCH_COUNT.147
15.3.4.2.6 QUERY_COUNT.148
15.3.4.2.7 UNLIMITED_BATCH.148
15.3.4.3 Constructors.148
15.3.4.3.1 ExecutionContext().148
15.3.4.4 Methods.148
15.3.4.4.1 cancel ().148
15.3.4.4.2 execute ().149
15.3.4.4.3 executeBatch ().150
15.3.4.4.4 executeQuery().151
15.3.4.4.5 executeUpdate().151
15.3.4.4.6 getBatchLimit().152
15.3.4.4.7 getBatchUpdateCounts().152
15.3.4.4.8 getFetchDirection ().153
15.3.4.4.9 getFetchSize().153
15.3.4.4.10 getMaxFieldSize().153
15.3.4.4.11 getMaxRows().154
15.3.4.4.12 getNextResultSet().154
15.3.4.4.13 getNextResultSet(int).154
15.3.4.4.14 getQueryTimeout().155
15.3.4.4.15 getUpdateCount().156
15.3.4.4.16 getWarnings().156
15.3.4.4.17 isBatching().156
15.3.4.4.18 registerStatement(ConnectionContext,Object,int).157
15.3.4.4.19 releaseStatement().158
15.3.4.4.20 setBatching(boolean).158
15.3.4.4.21 setBatchLimit (int).159
15.3.4.4.22 setFetchDirection (int).159
15.3.4.4.23 setFetchSize(int).160
15.3.4.4.24 setMaxFieldSize (int).160
15.3.4.4.25 setMaxRows(int).160
15.3.4.4.26 setQueryTimeout (int).161
15.3.5 sqlj.runtime.RuntimeContext.161
15.3.5.1 Class overview.161
15.3.5.2 Variables.161
15.3.5.2.1 DEFAULT_DATA_SOURCE.161
15.3.5.2.2 DEFAULT_RUNTIME.161
15.3.5.2.3 PROPERTY_KEY.162
15.3.5.3 Constructors.162
15.3.5.3.1 RuntimeContext().162
15.3.5.4 Methods.162
15.3.5.4.1 getDefaultConnection ().162
15.3.5.4.2 getLoaderForClass (Class).162
15.3.5.4.3 getRuntime().163
viii ©ISO/IEC2023–Allrightsreserved
---------------------- Page: 8 ----------------------
ISO/IEC9075-10:2023(E)
15.3.6 sqlj.runtime.StreamWrapper.163
15.3.6.1 Class overview.163
15.3.6.2 Constructors.164
15.3.6.2.1 StreamWrapper (InputStream).164
15.3.6.2.2 StreamWrapper(InputStream,int).164
15.3.6.3 Methods.164
15.3.6.3.1 getInputStream ().164
15.3.6.3.2 getLength().164
15.3.6.3.3 setLength(int).165
15.3.7 sqlj.runtime.UnicodeStream.165
15.3.7.1 Class overview.165
15.3.7.2 Constructors.165
15.3.7.2.1 UnicodeStream(InputStream).165
15.3.7.2.2 UnicodeStream(InputStream,int).166
15.3.8 sqlj.runtime.CharacterStream.166
15.3.8.1 Class overview.166
15.3.8.2 Constructors.166
15.3.8.2.1 CharacterStream (Reader).166
15.3.8.2.2 CharacterStream(Reader,int).166
15.3.8.3 Methods.167
15.3.8.3.1 getReader().167
15.3.8.3.2 getLength().167
15.3.8.3.3 setLength(int).
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.