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

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

Standard
ISO/IEC 9075-10:2023 - Information technology — Database languages SQL — Part 10: Object language bindings (SQL/OLB) Released:1. 06. 2023
English language
317 pages
sale 15% off
Preview
sale 15% off
Preview

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 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-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

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

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

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

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

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

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).167
15.3.9 sqlj.runtime.SQLNullException.167
15.3.9.1 Class overview.167
15.3.9.2 Constructors.168
15.3.9.2.1 SQLNullException ().168
16 Packagesqlj.runtime.profile.169
16.1 Overview.169
16.2 SQLJsqlj.runtime.profileinterfaces.169
16.2.1 sqlj.runtime.profile.BatchContext.169
16.2.1.1 Interfaceoverview.169
16.2.1.2 Methods.169
16.2.1.2.1 clearBatch().169
16.2.1.2.2 executeBatch ().169
16.2.1.2.3 setBatchLimit (int).170
16.2.2 sqlj.runtime.profile.ConnectedProfile.170
16.2.2.1 Interfaceoverview.170
16.2.2.2 Methods.171
16.2.2.2.1 close ().171
16.2.2.2.2 getConnection ().171
16.2.2.2.3 getProfileData ().172
16.2.2.2.4 getStatement(int,Map).172
16.2.2.2.5 getStatement(int,BatchContext,Map).173
16.2.3 sqlj.runtime.profile.Customization.173
16.2.3.1 Interfaceoverview.173
16.2.3.2 Methods.174
©ISO/IEC2023–Allrightsreserved ix

ISO/IEC9075-10:2023(E)
16.2.3.2.1 acceptsConnection(Connection).174
16.2.3.2.2 getProfile(Connection,Profile).174
16.2.4 sqlj.runtime.profile.Loader.175
16.2.4.1 Interfaceoverview.175
16.2.4.2 Methods.175
16.2.4.2.1 getResourceAsStream(String).175
16.2.4.2.2 loadClass (String).175
16.2.5 sqlj.runtime.profile.RTResultSet.176
16.2.5.1 Interfaceoverview.176
16.2.5.2 Methods.179
16.2.5.2.1 clearWarnings ().179
16.2.5.2.2 close ().179
16.2.5.2.3 findColumn (String).179
16.2.5.2.4 getArray(int).180
16.2.5.2.5 getAsciiStreamWrapper(int).180
16.2.5.2.6 getBigDecimal(int).181
16.2.5.2.7 getBinaryStreamWrapper (int).182
16.2.5.2.8 getBlob(int).183
16.2.5.2.9 getBooleanNoNull(int).183
16.2.5.2.10 getBooleanWrapper (int).184
16.2.5.2.11 getByteNoNull(int).185
16.2.5.2.12 getBytes(int).185
16.2.5.2.13 getByteWrapper (int).186
16.2.5.2.14 getCharacterStreamWrapper(int).187
16.2.5.2.15 getClob(int).188
16.2.5.2.16 getColumnCount ().188
16.2.5.2.17 getCursorName ().189
16.2.5.2.18 getDate(int).189
16.2.5.2.19 getDoubleNoNull(int).190
16.2.5.2.20 getDoubleWrapper(int).191
16.2.5.2.21 getFloatNoNull (int).191
16.2.5.2.22 getFloatWrapper(int).192
16.2.5.2.23 getIntNoNull (int).193
16.2.5.2.24 getIntWrapper(int).193
16.2.5.2.25 getJDBCResultSet().194
16.2.5.2.26 getLongNoNull (int).194
16.2.5.2.27 getLongWrapper(int).195
16.2.5.2.28 getObject(int,Class).196
16.2.5.2.29 getRef(int).197
16.2.5.2.30 getShortNoNull(int).197
16.2.5.2.31 getShortWrapper (int).198
16.2.5.2.32 getString (int).199
16.2.5.2.33 getSQLXML(int).199
16.2.5.2.34 getTime (int).200
16.2.5.2.35 getTimestamp(int).201
16.2.5.2.36 getUnicodeStreamWrapper(int).201
16.2.5.2.37 getURL(int).202
x ©ISO/IEC2023–Allrightsreserved

ISO/IEC9075-10:2023(E)
16.2.5.2.38 getWarnings().203
16.2.5.2.39 isClosed().203
16.2.5.2.40 isValidRow ().203
16.2.5.2.41 next().204
16.2.6 sqlj.runtime.profile.RTStatement.204
16.2.6.1 Interfaceoverview.204
16.2.6.2 Methods.209
16.2.6.2.1 cancel ().209
16.2.6.2.2 clearWarnings ().209
16.2.6.2.3 execute ().210
16.2.6.2.4 executeComplete().210
16.2.6.2.5 executeRTQuery().210
16.2.6.2.6 executeUpdate().211
16.2.6.2.7 getArray(int).211
16.2.6.2.8 getBatchContext().212
16.2.6.2.9 getBigDecimal(int).213
16.2.6.2.10 getBlob(int).213
16.2.6.2.11 getBooleanNoNull(int).214
16.2.6.2.12 getBooleanWrapper (int).215
16.2.6.2.13 getByteNoNull(int).215
16.2.6.2.14 getBytes(int).216
16.2.6.2.15 getByteWrapper (int).217
16.2.6.2.16 getClob(int).217
16.2.6.2.17 getDate(int).218
16.2.6.2.18 getDoubleNoNull(int).219
16.2.6.2.19 getDoubleWrapper(int).219
16.2.6.2.20 getFloatNoNull (int).220
16.2.6.2.21 getFloatWrapper(int).221
16.2.6.2.22 getIntNoNull (int).221
16.2.6.2.23 getIntWrapper(int).222
16.2.6.2.24 getJDBCCallableStatement ().223
16.2.6.2.25 getJDBCPreparedStatement ().223
16.2.6.2.26 getLongNoNull (int).223
16.2.6.2.27 getLongWrapper(int).224
16.2.6.2.28 getMaxFieldSize().225
16.2.6.2.29 getMaxRows().225
16.2.6.2.30 getMoreResults(int).225
16.2.6.2.31 getObject(int,Class).226
16.2.6.2.32 getQueryTimeout().227
16.2.6.2.33 getRef(int).228
16.2.6.2.34 getResultSet().228
16.2.6.2.35 getShortNoNull(int).229
16.2.6.2.36 getShortWrapper (int).229
16.2.6.2.37 getString (int).230
16.2.6.2.38 getSQLXML (int).231
16.2.6.2.39 getTime (int).231
16.2.6.2.40 getTimestamp(int).232
©ISO/IEC2023–Allrightsreserved xi

ISO/IEC9075-10:2023(E)
16.2.6.2.41 getUpdateCount().233
16.2.6.2.42 getURL ().233
16.2.6.2.43 getWarnings().234
16.2.6.2.44 isBatchable().234
16.2.6.2.45 isBatchCompatible().235
16.2.6.2.46 aetArray(int,Array).236
16.2.6.2.47 setAsciiStreamWrapper(int,AsciiStream).236
16.2.6.2.48 setBigDecimal(int,BigDecimal).237
16.2.6.2.49 setBinaryStreamWrapper(int,BinaryStream).238
16.2.6.2.50 setBlob(int,Blob).238
16.2.6.2.51 setBoolean(int,boolean).239
16.2.6.2.52 setBooleanWrapper(int,Boolean).239
16.2.6.2.53 setByte(int,byte).240
16.2.6.2.54 setBytes(int,byte).241
16.2.6.2.55 setByteWrapper(int,Byte).241
16.2.6.2.56 setCharacterStreamWrapper(int,CharacterStream).242
16.2.6.2.57 setClob(int,Clob).242
16.2.6.2.58 setDate(int,Date).243
16.2.6.2.59 setDouble(int,double).244
16.2.6.2.60 setDoubleWrapper(int,Double).244
16.2.6.2.61 setFloat(int,float).245
16.2.6.2.62 setFloatWrapper(int,Float).245
16.2.6.2.63 setInt(int,int).246
16.2.6.2.64 setIntWrapper(int,Integer).247
16.2.6.2.65 setLong(int,long).247
16.2.6.2.66 setLongWrapper(int,Long).248
16.2.6.2.67 setMaxFieldSize (int).248
16.2.6.2.68 setMaxRows(int).249
16.2.6.2.69 setObject().249
16.2.6.2.70 setQueryTimeout (int).250
16.2.6.2.71 setRef(int,Ref).250
16.2.6.2.72 setShort(int,short).
...

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...