Information technology Database languages SQL Technical Reports. Part 4: SQL with Routines and types using the Java TM programming language

Similar documents
This document is a preview generated by EVS

Information technology Database languages SQL Technical Reports. Part 3: SQL Embedded in Programs using the Java TM programming language

ISO/IEC TR TECHNICAL REPORT. Information technology Database languages SQL Technical Reports Part 1: XQuery Regular Expression Support in SQL

ISO/IEC INTERNATIONAL STANDARD. Information technology Cloud computing Reference architecture

ISO/IEC INTERNATIONAL STANDARD. Information technology Cloud computing Overview and vocabulary

ISO/IEC Information technology Security techniques Network security. Part 5:

ISO/IEC TR TECHNICAL REPORT. Information technology Telecommunications and information exchange between systems Managed P2P: Framework

Information technology Security techniques Mapping the revised editions of ISO/IEC and ISO/IEC 27002

This document is a preview generated by EVS

ISO/IEC INTERNATIONAL STANDARD. Information technology Dynamic adaptive streaming over HTTP (DASH) Part 2: Conformance and reference software

Information technology Guidelines for the application of ISO 9001:2008 to IT service management and its integration with ISO/IEC :2011

Technical Specification C++ Extensions for Coroutines

Information technology Extensions of Office Open XML file formats. Part 1: Guidelines

ISO/IEC INTERNATIONAL STANDARD. Information technology MPEG extensible middleware (MXM) Part 3: MXM reference software

ISO/IEC TR This is a preview - click here to buy the full publication TECHNICAL REPORT. First edition

ISO/IEC INTERNATIONAL STANDARD. Information technology Multimedia service platform technologies Part 2: MPEG extensible middleware (MXM) API

ISO/IEC First edition Reference number ISO/IEC 20005:2013(E) ISO/IEC 2013

ISO/IEC 1001 INTERNATIONAL STANDARD. Information technology File structure and labelling of magnetic tapes for information interchange

ISO/IEC INTERNATIONAL STANDARD. Information technology EAN/UCC Application Identifiers and Fact Data Identifiers and Maintenance

This document is a preview generated by EVS

ISO/IEC INTERNATIONAL STANDARD

ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Information security incident management

ISO/IEC Systems and software engineering Systems and software Quality Requirements and Evaluation (SQuaRE) Planning and management

Sýnishorn ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Information security risk management

ISO/IEC INTERNATIONAL STANDARD

This document is a preview generated by EVS

ISO/IEC TR TECHNICAL REPORT

Part 1: Numbering system

Identification cards Optical memory cards Holographic recording method. Part 3: Optical properties and characteristics

This document is a preview generated by EVS

ISO/IEC INTERNATIONAL STANDARD

ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Governance of information security

ISO/IEC TR TECHNICAL REPORT

ISO/IEC INTERNATIONAL STANDARD

Information technology Programming languages, their environments and system software interfaces Guidelines for language bindings

ISO/IEC INTERNATIONAL STANDARD. Information technology Icon symbols and functions for controlling multimedia software applications

ISO/IEC INTERNATIONAL STANDARD. Information technology Learning, education, and training Content packaging Part 2: XML binding

ISO/IEC TR TECHNICAL REPORT

ISO/IEC INTERNATIONAL STANDARD. Information technology JPEG 2000 image coding system: Reference software

ISO/IEC INTERNATIONAL STANDARD. Systems and software engineering Measurement process. Ingénierie des systèmes et du logiciel Processus de mesure

INTERNATIONAL STANDARD

ISO/IEC INTERNATIONAL STANDARD. Information technology Biometric data interchange formats Part 9: Vascular image data

ISO/IEC INTERNATIONAL STANDARD

ISO/IEC INTERNATIONAL STANDARD

ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Entity authentication

ISO/IEC INTERNATIONAL STANDARD

Information technology Security techniques Sector-specific application of ISO/IEC Requirements

ISO/IEC TR TECHNICAL REPORT

ISO/IEC TR TECHNICAL REPORT. Information technology Biometrics Multimodal and other multibiometric fusion

This document is a preview generated by EVS

ISO/IEC Information technology Icon symbols and functions for controlling multimedia software applications

ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Lightweight cryptography Part 2: Block ciphers

Sýnishorn. Information technology Dynamic adaptive streaming over HTTP (DASH) Part 1: Media presentation description and segment formats

Mobile robots Vocabulary

ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Information security risk management

ISO/IEC INTERNATIONAL STANDARD

This document is a preview generated by EVS

ISO/IEC INTERNATIONAL STANDARD. Information technology Multimedia service platform technologies Part 3: Conformance and reference software

ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Information security management systems Overview and vocabulary

Information technology Identification cards Biometric System-on-Card. Part 3: Logical information interchange mechanism

ISO/IEC TR TECHNICAL REPORT. Systems and software engineering Life cycle management Part 1: Guide for life cycle management

This document is a preview generated by EVS

This document is a preview generated by EVS

ISO/IEC INTERNATIONAL STANDARD. Information technology Multimedia application format (MPEG-A) Part 13: Augmented reality application format

Information technology Governance of IT Governance of data. Part 1: Application of ISO/IEC to the governance of data

ISO/IEC INTERNATIONAL STANDARD

This document is a preview generated by EVS

ISO/IEC INTERNATIONAL STANDARD. Colour test pages for measurement of office equipment consumable yield

ISO/IEC INTERNATIONAL STANDARD. Information technology Guideline for the evaluation and selection of CASE tools

ISO/IEC INTERNATIONAL STANDARD

ISO INTERNATIONAL STANDARD. Information and documentation International standard name identifier (ISNI)

ISO/IEC INTERNATIONAL STANDARD. Information technology JPEG 2000 image coding system Part 14: XML representation and reference

INTERNATIONAL STANDARD

ISO/IEC Information technology Sensor networks: Sensor Network Reference Architecture (SNRA) Part 2: Vocabulary and terminology

ISO/IEC INTERNATIONAL STANDARD. Information technology Mobile item identification and management Mobile AIDC application programming interface

ISO/IEC Information technology Automatic identification and data capture techniques Bar code scanner and decoder performance testing

ISO/IEC INTERNATIONAL STANDARD. Information technology Multimedia Middleware Part 6: Fault management

Systems and software engineering Information technology project performance benchmarking framework. Part 4:

ISO/IEC INTERNATIONAL STANDARD

Information technology Multimedia service platform technologies. Part 3: Conformance and reference software

ISO/IEC INTERNATIONAL STANDARD

ISO/IEC INTERNATIONAL STANDARD. Information technology Keyboard layouts for text and office systems Part 2: Alphanumeric section

Information technology Security techniques Application security. Part 5: Protocols and application security controls data structure

INTERNATIONAL STANDARD

INTERNATIONAL STANDARD

ISO/IEC INTERNATIONAL STANDARD. Information technology Vocabulary Part 37: Biometrics

ISO/IEC INTERNATIONAL STANDARD. Information technology Security techniques Hash-functions Part 2: Hash-functions using an n-bit block cipher

This document is a preview generated by EVS

ISO/IEC INTERNATIONAL STANDARD. Information technology CDIF transfer format Part 3: Encoding ENCODING.1

ISO/IEC INTERNATIONAL STANDARD

Transcription:

TECHNICAL REPORT ISO/IEC TR 19075-4 This is a preview of "ISO/IEC TR 19075-4:2...". Click here to purchase the full version from the ANSI store. First edition 2015-07-01 Information technology Database languages SQL Technical Reports Part 4: SQL with Routines and types using the Java TM programming language Technologies de l information Langages de base de données SQL rapports techniques Partie 4: SQL avec des Routines et Types Utilisant le Langage de Programmation de Java TM Reference number ISO/IEC TR 19075-4:2015(E) ISO/IEC 2015

ISO/IEC TR 19075-4:2015(E) This is a preview of "ISO/IEC TR 19075-4:2...". Click here to purchase the full version from the ANSI store. COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2015, Published in Switzerland All rights reserved. Unless otherwise specified, 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 Ch. de Blandonnet 8 CP 401 CH-1214 Vernier, Geneva, Switzerland Tel. +41 22 749 01 11 Fax +41 22 749 09 47 copyright@iso.org www.iso.org ii ISO/IEC 2015 All rights reserved

Contents Page Foreword...................................................................................... v Introduction................................................................................... vi 1 Scope.................................................................................... 1 2 Normative references...................................................................... 3 2.1 ISO and IEC standards.................................................................... 3 2.2 Other international standards............................................................... 3 3 Routines tutorial.......................................................................... 5 3.1 Technical components..................................................................... 5 3.2 Overview............................................................................... 5 3.3 Example Java methods: region and correctstates................................................ 6 3.4 Installing region and correctstates in SQL..................................................... 7 3.5 Defining SQL names for region and correctstates............................................... 8 3.6 A Java method with output parameters: besttwoemps........................................... 9 3.7 A CREATE PROCEDURE best2 for besttwoemps............................................ 11 3.8 Calling the best2 procedure............................................................... 12 3.9 A Java method returning a result set: orderedemps............................................. 12 3.10 A CREATE PROCEDURE rankedemps for orderedemps....................................... 14 3.11 Calling the rankedemps procedure.......................................................... 15 3.12 Overloading Java method names and SQL names.............................................. 15 3.13 Java main methods...................................................................... 17 3.14 Java method signatures in the CREATE statements............................................. 18 3.15 Null argument values and the RETURNS NULL clause......................................... 19 3.16 Static variables......................................................................... 21 3.17 Dropping SQL names of Java methods....................................................... 22 3.18 Removing Java classes from SQL.......................................................... 22 3.19 Replacing Java classes in SQL............................................................. 23 3.20 Visibility.............................................................................. 24 3.21 Exceptions............................................................................. 24 3.22 Deployment descriptors.................................................................. 25 3.23 Paths................................................................................. 28 3.24 Privileges.............................................................................. 30 3.25 Information Schema..................................................................... 30 4 Types tutorial............................................................................ 33 4.1 Overview.............................................................................. 33 4.2 Example Java classes.................................................................... 33 Contents iii

4.3 Installing Address and Address2Line in an SQL system......................................... 35 4.4 CREATE TYPE for Address and Address2Line................................................ 36 4.5 Multiple SQL types for a single Java class.................................................... 37 4.6 Collapsing subclasses.................................................................... 38 4.7 GRANT and REVOKE statements for data types.............................................. 40 4.8 Deployment descriptors for classes......................................................... 40 4.9 Using Java classes as data types............................................................ 41 4.10 SELECT, INSERT, and UPDATE........................................................... 42 4.11 Referencing Java fields and methods in SQL.................................................. 43 4.12 Extended visibility rules.................................................................. 43 4.13 Logical representation of Java instances in SQL............................................... 44 4.14 Static methods.......................................................................... 45 4.15 Static fields............................................................................ 46 4.16 Instance-update methods.................................................................. 46 4.17 Subtypes in SQL/JRT data................................................................ 48 4.18 References to fields and methods of null instances............................................. 49 4.19 Ordering of SQL/JRT data................................................................ 51 Index........................................................................................ 53 iv SQL with Routines and Types Using the Java Programming Language

Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) 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, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. In exceptional circumstances, when the joint technical committee has collected data of a different kind from that which is normally published as an International Standard ( state of the art, for example), it may decide to publish a Technical Report. A Technical Report is entirely informative in nature and shall be subject to review every five years in the same manner as an International Standard. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC TR 19075-4 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 32, Data management and interchange. ISO/IEC TR 19075 consists of the following parts, under the general title Information technology Database languages SQL Technical Reports: Part 1: XQuery Regular Expression Support in SQL Part 2: SQL Support for Time-Related Information Part 3: SQL Embedded in Programs Using the Java Programming Language Part 4: SQL with Routines and Types Using the Java Programming Language Part 5: Row Pattern Recognition in SQL NOTE 1 The individual parts of multi-part technical reports are not necessarily published together. New editions of one or more parts may be published without publication of new editions of other parts. Foreword v

Introduction The organization of this part of ISO/IEC 19075 is as follows: 1) Clause 1, Scope, specifies the scope of this part of ISO/IEC 19075. 2) Clause 2, Normative references, identifies additional standards that, through reference in this part of ISO/IEC 19075, constitute provisions of this part of ISO/IEC 19075. 3) Clause 3, Routines tutorial, provides a tutorial on the use of routines written in the Java programming language within SQL expressions and statements. 4) Clause 4, Types tutorial, provides a tutorial on the use of user-defined types written in the Java programming language within SQL expressions and statements. vi SQL with Routines and Types Using the Java Programming Language

ISO/IEC TR 19075-4:2015(E) This is a preview of "ISO/IEC TR 19075-4:2...". Click here to purchase the full version from the ANSI store. COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2015, Published in Switzerland All rights reserved. Unless otherwise specified, 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 Ch. de Blandonnet 8 CP 401 CH-1214 Vernier, Geneva, Switzerland Tel. +41 22 749 01 11 Fax +41 22 749 09 47 copyright@iso.org www.iso.org ii ISO/IEC 2015 All rights reserved

Contents Page Foreword...................................................................................... v Introduction................................................................................... vi 1 Scope.................................................................................... 1 2 Normative references...................................................................... 3 2.1 ISO and IEC standards.................................................................... 3 2.2 Other international standards............................................................... 3 3 Routines tutorial.......................................................................... 5 3.1 Technical components..................................................................... 5 3.2 Overview............................................................................... 5 3.3 Example Java methods: region and correctstates................................................ 6 3.4 Installing region and correctstates in SQL..................................................... 7 3.5 Defining SQL names for region and correctstates............................................... 8 3.6 A Java method with output parameters: besttwoemps........................................... 9 3.7 A CREATE PROCEDURE best2 for besttwoemps............................................ 11 3.8 Calling the best2 procedure............................................................... 12 3.9 A Java method returning a result set: orderedemps............................................. 12 3.10 A CREATE PROCEDURE rankedemps for orderedemps....................................... 14 3.11 Calling the rankedemps procedure.......................................................... 15 3.12 Overloading Java method names and SQL names.............................................. 15 3.13 Java main methods...................................................................... 17 3.14 Java method signatures in the CREATE statements............................................. 18 3.15 Null argument values and the RETURNS NULL clause......................................... 19 3.16 Static variables......................................................................... 21 3.17 Dropping SQL names of Java methods....................................................... 22 3.18 Removing Java classes from SQL.......................................................... 22 3.19 Replacing Java classes in SQL............................................................. 23 3.20 Visibility.............................................................................. 24 3.21 Exceptions............................................................................. 24 3.22 Deployment descriptors.................................................................. 25 3.23 Paths................................................................................. 28 3.24 Privileges.............................................................................. 30 3.25 Information Schema..................................................................... 30 4 Types tutorial............................................................................ 33 4.1 Overview.............................................................................. 33 4.2 Example Java classes.................................................................... 33 Contents iii

4.3 Installing Address and Address2Line in an SQL system......................................... 35 4.4 CREATE TYPE for Address and Address2Line................................................ 36 4.5 Multiple SQL types for a single Java class.................................................... 37 4.6 Collapsing subclasses.................................................................... 38 4.7 GRANT and REVOKE statements for data types.............................................. 40 4.8 Deployment descriptors for classes......................................................... 40 4.9 Using Java classes as data types............................................................ 41 4.10 SELECT, INSERT, and UPDATE........................................................... 42 4.11 Referencing Java fields and methods in SQL.................................................. 43 4.12 Extended visibility rules.................................................................. 43 4.13 Logical representation of Java instances in SQL............................................... 44 4.14 Static methods.......................................................................... 45 4.15 Static fields............................................................................ 46 4.16 Instance-update methods.................................................................. 46 4.17 Subtypes in SQL/JRT data................................................................ 48 4.18 References to fields and methods of null instances............................................. 49 4.19 Ordering of SQL/JRT data................................................................ 51 Index........................................................................................ 53 iv SQL with Routines and Types Using the Java Programming Language

Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) 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, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. In exceptional circumstances, when the joint technical committee has collected data of a different kind from that which is normally published as an International Standard ( state of the art, for example), it may decide to publish a Technical Report. A Technical Report is entirely informative in nature and shall be subject to review every five years in the same manner as an International Standard. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC TR 19075-4 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 32, Data management and interchange. ISO/IEC TR 19075 consists of the following parts, under the general title Information technology Database languages SQL Technical Reports: Part 1: XQuery Regular Expression Support in SQL Part 2: SQL Support for Time-Related Information Part 3: SQL Embedded in Programs Using the Java Programming Language Part 4: SQL with Routines and Types Using the Java Programming Language Part 5: Row Pattern Recognition in SQL NOTE 1 The individual parts of multi-part technical reports are not necessarily published together. New editions of one or more parts may be published without publication of new editions of other parts. Foreword v

Introduction The organization of this part of ISO/IEC 19075 is as follows: 1) Clause 1, Scope, specifies the scope of this part of ISO/IEC 19075. 2) Clause 2, Normative references, identifies additional standards that, through reference in this part of ISO/IEC 19075, constitute provisions of this part of ISO/IEC 19075. 3) Clause 3, Routines tutorial, provides a tutorial on the use of routines written in the Java programming language within SQL expressions and statements. 4) Clause 4, Types tutorial, provides a tutorial on the use of user-defined types written in the Java programming language within SQL expressions and statements. vi SQL with Routines and Types Using the Java Programming Language