SQLJ: Java and Relational Databases

Total Page:16

File Type:pdf, Size:1020Kb

SQLJ: Java and Relational Databases SQLJ: Java and Relational Databases Phil Shaw, Sybase Inc. Brian Becker, Oracle Corp. Johannes Klein, Tandem/Compaq Mark Hapner, JavaSoft Gray Clossman, Oracle Corp. Richard Pledereder, Sybase Inc. Agenda ➨ Introduction ✔ SQLJ Part 0: Embedded SQL and Portability Profile ✔ SQLJ Part 1: Java Methods as SQL Procedures ✔ SQLJ Part 2: Java Classes as SQL Types 1 Java and Databases –JDBC • Java Database Connectivity API • Widely Implemented –SQLJ™ • Java-Relational Database Technology • Portability; Productivity; Java in the Database • Leverages JDBC technology –JavaBlend • Object/Relational Mapping for Java – The focus of this tutorial is on SQLJ SQLJ - The Consortium – Structure is informal • Participants include Oracle, IBM, Sybase, Tandem, JavaSoft, Microsoft, Informix, XDB • Open to other participants – Meetings • Approximately every 3-4 weeks • Hosted by one of the Bay Area resident vendors (Oracle, Sybase, Tandem, JavaSoft, Informix, etc.) • Participants: Product Architects + SQL Standards people 2 SQLJ - The Technology – Part 0: SQLJ Embeded SQL • Mostly reviewed and implemented • Integrated with JDBC API • Oracle has placed Translator source into public domain – Part 1: SQLJ Stored Procedures and UDFs • Using Java static methods as SQL stored procedures & functions • Leverages JDBC API – Part 2: SQLJ Data Types • Pure Java Classes as SQL ADTs • Alternative to SQL3 Abstract Data Types SQLJ - The Standard – Goal of the SQLJ Consortium is to create workable standards specifications in web time – The Consortium is working with ANSI X3H2 on a fast- track process for adopting SQLJ as a standard – The Consortium also works with The Open Group on a set of conformance tests 3 SQLJ - Implementation Status – SQLJ Embedded SQL • Public-domain reference implementation available from Oracle http://www.oracle.com/st/products/jdbc/sqlj • Profile customizations available from Oracle, IBM, Sybase, Tandem, … – SQLJ Procedures • Specifications mostly reviewed • Implementations, e.g., Sybase Adaptive Server Anywhere 6.0, Oracle 8.1, IBM – SQLJ Data Types • Specifications through first pass • Implementations, e.g., Sybase Adaptive Server Anywhere 6.0 JDBC 2.0 - SQLJ Features ✔ Support for user-defined, object data types – Java Classes • Persistent Java objects stored in the DBMS – SQL3 types • BLOB, CLOB, array, reference • Structured and distinct types ✔ New type codes – JAVA_OBJECT, STRUCT, BLOB, etc. – Metadata for user-defined types int[] types = {Types.JAVA_OBJECT}; ResultSet rs = dmd.getUDTs("catalog-name", "schema-name", "%", types); 4 JDBC 2.0 - SQLJ Features ✔ Objects-by-Value – Java Classes as database types •this just works – SQL3 ADTs as database types • Java mapping maintained per Connection – Seamless extension of get/setObject() Statement stmt; … ResultSet rs = stmt.executeQuery( "SELECT CUSTOMER FROM ACCOUNTS"); rs.next(); Customer cust = (Customer)rs.getObject(1); Agenda ✔ Overview and JDBC 2.0: New Features ➨ SQLJ Part 0: Embedded SQL and Portability Profile ✔ SQLJ Part 1: Java Methods as SQL Procedures ✔ SQLJ Part 2: Java Classes as SQL Types 5 SQLJ Part 0: SQL Embedded in Java ✔ Objectives – Simple, concise language for embedding SQL statements in Java programs – Standard to allow for assembly of binary components produced by different tools – Standard to allow for binary portability across different database systems Advantages – Ahead-of-time syntax and type checking – Strongly typed cursors (iterators) – Offline pre-compilation (for performance) – Deployment-time customization (for binary portability and native pre-compilation) 6 SQLJ clauses – SQLJ statements start with “#sql” – SQLJ statements terminate with “;” – SQLJ host variables start with “:” – SQL text is enclosed in curly braces “{..}” int n; #sql { INSERT INTO emp VALUES (:n) }; SQLJ more concise than JDBC // SQLJ int n; #sql { INSERT INTO emp VALUES (:n)}; // JDBC int n; Statement stmt = conn.prepareStatement (“INSERT INTO emp VALUES (?)”); stmt.setInt(1,n); stmt.execute (); stmt.close(); 7 Strongly typed cursors – Positional binding to columns #sql public iterator ByPos (String, int); ByPos positer; String name = null; int year = 0; #sql positer = { SELECT name, year FROM people}; while (true) { #sql { FETCH :positer INTO :name, :year}; if (positer.endFetch()) break; // process name, year } positer.close(); Strongly typed cursors (cont.) – Named binding to columns #sql public iterator ByName (int year, String name); ByName namiter; String name = null; int year = 0; #sql namiter = { SELECT name, year FROM people}; while (namiter.next()) { name = namiter.name(); year = namiter.year(); // process name, year } namiter.close(); 8 Connection context – SQLJ statements are associated with a connection context – Context type identifies exemplar schema, e.g. views, tables, privileges #sql context Department; Department dept = newDepartment(“jdbc:odbc:acme.cs”); int n; #sql [dept] { insert into EMP values (:n)}; Extensible SQLJ framework – Database vendors plug-in SQL syntax checkers and semantic analyzers using SQLChecker framework – Database vendors provide customizers to install SQLJ “binaries” (profiles) in target database – Default SQLJ binaries run on any JDBC driver 9 SQLJ translator framework Java Class Files SQLChecker SQLJ program Java Frontend SQLJ Profile SQLJ Customizations Customizer Profiles Utility SQLJ Translator SQLJ JAR FILE SQLJ portability layers SQLJ Program Profile Entries JDBC SQL DBSQL DB SQL DB 10 Custom SQL execution SQLJ Program Profile Entries JDBC Customizations SQL Module Stored procedure TP service SQL DBSQL DB SQL DB Profile customization selection Profile Customizations Data source URLs 11 SQLJ profile objects Profile ProfileData EntryInfo TypeInfo Customization ConnectedProfile RTStatement SQLJ compilation phases SQLJ Translator SQLJ Foo.sqlj Foo.java Compiler Java Foo.class 12 SQLJ translation phase Foo.sqlj Translator SQLJ SQLJ semantic analysis Foo.sqlj Translator SQLJ [Ctx0] {SQL0} describe(SQL0) SQLChecker0 13 SQLJ semantic analysis Foo.sqlj Translator SQLJ [Ctx0] {SQL0} [Ctx0] {SQL1} describe(SQL1) SQLChecker0 SQLJ semantic analysis Foo.sqlj Translator SQLJ [Ctx0] {SQL0} [Ctx0] {SQL1} (Ctx1) {SQL2} describe(SQL2) SQLChecker0 SQLChecker1 14 SQLJ code generation Foo.sqlj Translator SQLJ Foo.java [Ctx0] {SQL0} [Ctx0] {SQL1} [Ctx1] {SQL2} SQLJ code generation Foo.jsql Translator SQLJ Foo.java [Ctx0] Profile0: {SQL0} Entry0 [Ctx0] {SQL1} [Ctx1) ]SQL2} Profile0.ser Entry0 15 SQLJ code generation Foo.jsql Translator SQLJ Foo.java [Ctx0] Profile0: {SQL0} Entry0 [Ctx0] Profile0: {SQL1} Entry1 [Ctx1] {SQL2} Profile0.ser Entry0 Entry1 SQLJ code generation Foo.jsql Translator SQLJ Foo.java [Ctx0] Profile0: {SQL0} Entry0 [Ctx0] Profile0: {SQL1} Entry1 [Ctx1] Profile1: {SQL2} Entry0 Profile0.ser Entry0 Entry1 Profile1.ser Entry0 16 Java compilation SQLJ Translator SQLJ Foo.sqlj Foo.java Compiler Java Foo.class [Ctx0] Profile0: Profile0: {SQL0} Entry0 Entry0 [Ctx0] Profile0: Profile0: {SQL1} Entry1 Entry1 [Ctx1] Profile1: Profile1: {SQL2} Entry0 Entry0 Profile0.ser Entry0 Entry1 Profile1.ser Entry0 SQLJ packaging Foo.jar SQLJ Translator SQLJ Foo.sqlj Foo.java Compiler Java Foo.class [Ctx0] Profile0: Profile0: {SQL0} Entry0 Entry0 [Ctx0] Profile0: Profile0: {SQL1} Entry1 Entry1 [Ctx1] Profile1: Profile1: {SQL2} Entry0 Entry0 Profile0.ser Entry0 Entry1 Profile1.ser Entry0 17 SQLJ installation phase Foo.jar Foo.class Profile0.ser Profile1.ser SQLJ installation phase Foo.jar Foo.jar Foo.class Foo.class Customizer1 Profile0.ser Profile0.ser Customization Profile1.ser Profile1.ser 18 SQLJ installation phase Foo.jar Foo.jar Foo.jar Foo.class Foo.class Foo.class Customizer1 Customizer2 Profile0.ser Profile0.ser Profile0.ser Customization1 Customization1 Customization2 Profile1.ser Profile1.ser Profile1.ser Customization2 Agenda ✔ JDBC 2.0: New Features ✔ SQLJ Part 0: Embedded SQL and Portability Profile ➨ SQLJ Part 1: Java Methods as SQL Procedures ✔ SQLJ Part 2: Java Classes as SQL Types 19 SQLJ Part 1: Java methods as SQL procedures ✔ Use Java static methods as SQL stored procedures and functions. – Advantage to SQL: Direct use of pre-written Java libraries. ✔ A procedural and scripting language for SQL. – Portable across DBMSs. – Deployable across tiers. Technical objectives – Convenient for Java programmers. • Not just aimed at SQL programmers. – Portable across DBMSs. – Same capability as regular SQL stored procedures. • Arbitrary SQL stored procedures re-codable as SQLJ stored procedures. – Convenience and performance comparable with SQL routines. – Callable from CLI/ODBC, from other SQL stored procedures, from JDBC/JSQL, and directly from Java. • Caller needn't know the SQLJ stored procedure is in Java. 20 Technical objectives (cont.) – Any Java static method callable as a stored procedure: • Initially support only parameter and result types mappable to SQL. • Extensible to support arbitrary Java types, for Java caller and callee. – Body of SQLJ stored procedure routines can use JDBC and/or SQLJ to access SQL, or Java computation – Initially support persistence only for duration of a call. • Consider session and database persistence as follow-on. Topics – Example Java classes – Defining Java classes to SQL • Installing jar files • Specifying SQL names •SQL Permissions – OUT parameters – Result sets – Error handling –Paths – Deployment descriptors 21 Examples – Example table: create table emps ( name varchar(50), id char(5), state char(20), sales decimal (6,2)); – Example classes and methods: • Routines1.region – Maps a state code to a region
Recommended publications
  • Informix Embedded SQLJ User's Guide
    Informix Embedded SQLJ User’s Guide Version 1.0 March 1999 Part No. 000-5218 Published by INFORMIX Press Informix Corporation 4100 Bohannon Drive Menlo Park, CA 94025-1032 © 1999 Informix Corporation. All rights reserved. The following are trademarks of Informix Corporation or its affiliates: Answers OnLineTM; CBT StoreTM; C-ISAM ; Client SDKTM; ContentBaseTM; Cyber PlanetTM; DataBlade ; Data DirectorTM; Decision FrontierTM; Dynamic Scalable ArchitectureTM; Dynamic ServerTM; Dynamic ServerTM, Developer EditionTM; Dynamic ServerTM with Advanced Decision Support OptionTM; Dynamic ServerTM with Extended Parallel OptionTM; Dynamic ServerTM with MetaCube ROLAP Option; Dynamic ServerTM with Universal Data OptionTM; Dynamic ServerTM with Web Integration OptionTM; Dynamic ServerTM, Workgroup EditionTM; FastStartTM; 4GL for ToolBusTM; If you can imagine it, you can manage itSM; Illustra ; INFORMIX ; Informix Data Warehouse Solutions... Turning Data Into Business AdvantageTM; INFORMIX -Enterprise Gateway with DRDA ; Informix Enterprise MerchantTM; INFORMIX -4GL; Informix-JWorksTM; InformixLink ; Informix Session ProxyTM; InfoShelfTM; InterforumTM; I-SPYTM; MediazationTM; MetaCube ; NewEraTM; ON-BarTM; OnLine Dynamic ServerTM; OnLine for NetWare ; OnLine/Secure Dynamic ServerTM; OpenCase ; ORCATM; Regency Support ; Solution Design LabsSM; Solution Design ProgramSM; SuperView ; Universal Database ComponentsTM; Universal Web ConnectTM; ViewPoint ; VisionaryTM; Web Integration SuiteTM. The Informix logo is registered with the United States Patent and Trademark Office. The DataBlade logo is registered with the United States Patent and Trademark Office. Documentation Team: Joyce Simmonds, Juliet Shackell, Ju-Lung Tseng, Barb Van Dine, and the Oakland Editing and Production team GOVERNMENT LICENSE RIGHTS Software and documentation acquired by or for the US Government are provided with rights as follows: (1) if for civilian agency use, with rights as restricted by vendor’s standard license, as prescribed in FAR 12.212; (2) if for Dept.
    [Show full text]
  • Oracle Database SQLJ Developer's Guide
    Oracle® Database SQLJ Developer’s Guide and Reference 10g Release 2 (10.2) B16018-02 August 2006 Oracle Database SQLJ Developer’s Guide and Reference, 10g Release 2 (10.2) B16018-02 Copyright © 1999, 2006, Oracle. All rights reserved. Primary Author: Venkatasubramaniam Iyer Contributing Author: Brian Wright, Janice Nygard Contributor: Quan Wang, Ekkehard Rohwedder, Amit Bande, Krishna Mohan, Amoghavarsha Ramappa, Brian Becker, Alan Thiesen, Lei Tang, Julie Basu, Pierre Dufour, Jerry Schwarz, Risto Lakinen, Cheuk Chau, Vishu Krishnamurthy, Rafiul Ahad, Jack Melnick, Tim Smith, Thomas Pfaeffle, Tom Portfolio, Ellen Barnes, Susan Kraft, Sheryl Maring, Angie Long The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S.
    [Show full text]
  • Database Programming Week 9
    Database Programming Week 9 *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford SQL in Real Programs • We have seen only how SQL is used at the generic query interface --- an environment where we sit at a terminal and ask queries of a database. • Reality is almost always different. – Programs in a conventional language like C are written to access a database by “calls” to SQL statements. 2 Database Programming Code in Programming Language SQL Sequence of tuples Database 3 SQL in Application Code • SQL commands can be called from within a host language (e.g., C++ or Java) program. – SQL statements can refer to host variables (including special variables used to return status). – Must include a statement to connect to the right database. • Two main integration approaches: – Embed SQL in the host language (embedded SQL, SQLJ) – Create special API to call SQL commands (JDBC) 4 SQL in Application Code (Con’t) • Impedance mismatch – SQL relations are (multi-) sets of records, with no a priori bound on the number of records. Typically, no such data structure in programming languages such as C/ C++ (Though now: STL). – SQL supports a mechanism called a cursor to handle this. 5 Embedded SQL • Approach: Embed SQL in the host language. – A preprocessor converts/translates the SQL statements into special API calls. – Then a regular compiler is used to compile the code. 6 Embedded SQL • Language constructs: – Connecting to a database !EXEC SQL CONNECT :usr_pwd;! !// the host variable usr_pwd contains your
    [Show full text]
  • Proposed Final Draft
    Java™ 2 Platform Enterprise Edition Specification, v1.3 Please send technical comments to: [email protected] Please send business comments to: [email protected] Proposed Final Draft Proposed Final Draft - 10/20/00 Bill Shannon 901 San Antonio Road Palo Alto, CA 94303 USA 650 960-1300 fax: 650 969-9131 Sun Microsystems, Inc. Java™ 2 Platform, Enterprise Edition Specification ("Specification") Version: 1.3 Status: Proposed FInal Draft Release: 10/20/00 Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303, U.S.A. All rights reserved. NOTICE. This Specification is protected by copyright and the information described herein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of this Specification may be reproduced in any form by any means without the prior written authorization of Sun Microsystems, Inc. (“Sun”) and its licensors, if any. Any use of this Specification and the information described herein will be governed by the terms and conditions of this license and the Export Control and General Terms as set forth in Sun's website Legal Terms. By viewing, downloading or otherwise copying this Specification, you agree that you have read, understood, and will comply with all of the terms and conditions set forth herein. Subject to the terms and conditions of this license, Sun hereby grants you a fully-paid, non-exclusive, non-transferable, worldwide, limited license (without the right to sublicense) under Sun’s intellectual property rights to review the Specification internally for the purposes of evaluation only.
    [Show full text]
  • SQL — Part 13: SQL Routines and Types Using the Java TM Programming Language (SQL/JRT)
    INTERNATIONAL ISO/IEC STANDARD 9075-13 Fourth edition 2016-12-15 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 9075-13:2016(E) © ISO/IEC 2016 ISO/IEC 9075-13:2016(E) COPYRIGHT PROTECTED DOCUMENT © ISO/IEC 2016, Published in Switzerland All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form orthe by requester. 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 Ch. de Blandonnet 8 • CP 401 ISOCH-1214 copyright Vernier, office Geneva, Switzerland Tel. +41 22 749 01 11 Fax +41 22 749 09 47 www.iso.org [email protected] ii © ISO/IEC 2016 – All rights reserved ISO/IEC 9075-13:2016(E) Contents Page Foreword..................................................................................... vii Introduction.................................................................................. viii 1 Scope.................................................................................... 1 2 Normative references...................................................................... 3 2.1 ISO and IEC standards...................................................................
    [Show full text]
  • SQLJ Tool Note! Before Using This Information and the Product It Supports, Be Sure to Read the General Information Under Notices
    IBMVisualAgeforJava,Version3.0,EarlyAdopters Environment for the Java 2 platform, Standard Edition V1.2 IBM SQLJ Tool Note! Before using this information and the product it supports, be sure to read the general information under Notices. Edition notice This edition applies to Version 3.0 of IBM VisualAge for Java and to all subsequent releases and modifications until otherwise indicated in new editions. © Copyright International Business Machines Corporation 1999. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Notices ...............v Translating an imported SQLJ file .......6 Programming Interface Information ......vi Editing an SQLJ file ............7 Trademarks and Service Marks ........vii Keeping your SQLJ file and Java code synchronized 7 Setting SQLJ translation options ........8 Chapter 1. Database access using SQLJ 1 Creating an SQLJ debug class file .......8 Customizing an SQLJ profile .........9 Changing the SQLJ translator class .......9 Chapter 2. Before you begin ......3 Setting up SQLJ .............3 Appendix. SQLJTranslatorSupportToolProperties Chapter 3. Component tasks ......5 file ................11 Creating an SQLJ file ...........5 Importing and translating an SQLJ file......5 © Copyright IBM Corp. 1999 iii iv SQLJ Tool Notices Note to U.S. Government Users Restricted Rights -- use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area.
    [Show full text]
  • Chapter 3 DB Gateways.Pptx
    Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 [email protected] Chapter 3 DB-Gateways Outline n Coupling DBMS and programming languages n approaches n requirements n Programming Model (JDBC) n overview n DB connection model n transactions n Data Access in Distributed Information System Middleware n DB-Gateways n architectures n ODBC n JDBC n SQL/OLB – embedded SQL in Java n Summary 2 © Prof.Dr.-Ing. Stefan Deßloch Middleware for Information Systems Coupling Approaches – Overview n Embedded SQL n (static) SQL queries are embedded in the programming language n cursors to bridge so-called impedance mismatch n preprocessor converts SQL into function calls of the programming language n potential performance advantages (early query compilation) n vendor-specific n Dynamic (embedded) SQL n SQL queries can be created dynamically by the program n character strings interpreted as SQL statements by an SQL system n Call-Level Interface (CLI) n standard library of functions that can be linked to the program n same capabilities as (static and dynamic) embedded n SQL queries are string parameters of function invocation n avoids vendor-specific precompiler 3 © Prof.Dr.-Ing. Stefan Deßloch Middleware for Information Systems Coupling Approaches (Examples) n Embedded SQL n static n Example: exec sql declare c cursor for SELECT empno FROM Employees WHERE dept = :deptno_var; exec sql open c; exec sql fetch c into :empno_var; n dynamic n Example: strcpy(stmt, "SELECT empno FROM Employees WHERE dept = ?"); exec sql prepare s1 from :stmt; exec sql declare c cursor for s1; exec sql open c using :deptno_var; exec sql fetch c into :empno_var; n Call-Level Interface (CLI) n Example: strcpy(stmt, "SELECT empno FROM Employees WHERE dept = ?"); SQLPrepare(st_handle, stmt, …); SQLBindParam(st_handle, 1, …, &deptno_var, …); SQLBindCol(st_handle, 1, …, &empno_var, …); SQLExecute(st_handle); SQLFetch(st_handle); 4 © Prof.Dr.-Ing.
    [Show full text]
  • Embedded SQL in Java
    SQLJ: Embedded SQL in Java This chapter introduces SQLJ, a relatively new standard that many database vendors have already adopted. SQLJ differs from JDBC in that SQL statements can be embedded directly in Java programs and translation-time semantics checks can be performed. It is a powerful tool that complements JDBC access to databases. Programming in SQLJ is discussed in detail in this chapter, and an application program for the investment portfolio database is presented. 6.1 What Is SQLJ? SQLJ is an emerging database programming tool that allows embedding of static SQL statements in Java programs, very much like Pro*C or Pro*C++. SQLJ is an attractive alternative to JDBC because it allows translation-time syntax and semantics checking of static SQL statements. As a consequence, application programs developed in SQLJ are more robust. SQLJ’s syntax is also much more compact than that of JDBC, resulting in shorter programs and increased user productivity. The SQLJ translator converts Java programs embedded with static SQL state- ments into pure Java code, which can then be executed through a JDBC driver against the database. Programmers can also perform dynamic SQL access to the database using JDBC features. 273 274 SQLJ: Embedded SQL in Java 6.2 Simple Example A simple program in SQLJ is presented in this section. This program illustrates the essential steps that are needed to write an SQLJ program. These steps follow: 1. Import necessary classes.In addition to the JDBC classes, java.sql.*, every SQLJ program will need to include the SQLJ run-time classes sqlj.runtime.* and sqlj.runtime.ref.*.
    [Show full text]
  • Part One: Java in the Database1
    Part One: Java in the Database1 At the beginning was SQL, a high-level query language for relational databases. Then the need to extend SQL with procedural logic gave birth to the concept of stored procedures and their corresponding languages such as Oracle’s PL/SQL. Stored procedures allow developing data logic that run in the database, decoupled from business and computational logic that run in the middle tier. However, the proprietary nature of stored procedure languages, leads to some concerns (or perception) of vendor lock-in and skills shortage. Java is a response to these concerns. The ANSI SQLJ Part-I specification defines “SQL Routines and Types Using Java”. Although there are differences in their specific implementations, most RDBMS including Oracle, DB2, Sybase, even open-sources RDBMS such as PostGresSQL and to some extent MySQL, support Java as language for stored procedures and user-defined functions. Chapter One discusses the rationale for stored procedures, the programming model and languages. Chapter Two tells you everything you ever wanted to know about the OracleJVM, its architecture, memory management, threading, class sharing techniques, the native Java compiler (NCOMP), security management, and contrasts it with the JDK VM. Chapter Three delves into the details of developing, deploying, and invoking Java applications in the database, including an extensive section on PL/SQL wrappers (a.k.a. Call Spec) for publishing Java (i.e., make it known) to SQL, and mapping SQL datatypes to/from Java/JDBC datatypes. Chapter Four describes atypical Java applications, which implement new database functionality using standard Java libraries. Finally, just for fun, in Chapter Five, you will run basic JACL, Jython, Scheme and Groovy scripts in the database, as proof of the concept of supporting non-Java languages in the database2.
    [Show full text]
  • IBM Informix Embedded SQLJ User's Guide
    IBM Informix Embedded SQLJ User’s Guide Version 1.01 March 2003 Part No. CT1WSNA Note: Before using this information and the product it supports, read the information in the appendix entitled “Notices.” This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1996, 2003. All rights reserved. US Government User Restricted Rights—Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ii IBM Informix Embedded SQLJ User’s Guide Table of Contents Table of Contents Introduction In This Introduction ................. 3 About This Manual.................. 3 Organization of This Manual ............. 3 Types of Users .................. 4 Software Dependencies ............... 5 Global Language Support .............. 5 Documentation Conventions .............. 6 Typographical Conventions ............. 6 Icon Conventions ................. 7 Additional Documentation ............... 8 Related Manuals ................. 8 Documentation Notes and Release Notes ......... 9 Vendor-Specific Documentation ............ 9 IBM Welcomes Your Comments ............. 10 Chapter 1 Introducing IBM Informix Embedded SQLJ In This Chapter ................... 1-3 What Is Embedded SQLJ? ............... 1-3 How Does Embedded SQLJ Work? ............ 1-4 Embedded SQLJ Versus JDBC .............. 1-5 Chapter 2 Preparing to Use Embedded SQLJ In This Chapter ................... 2-3 What Components Do You Need? ............. 2-3 Setting Up Your Software ............... 2-4 Examples....................
    [Show full text]
  • Part 13:SQL Routines and Types Using the Java™ Programming Language
    INTERNATIONAL ISO/IEC This preview is downloaded from www.sis.se.STANDARD Buy the entire standard via https://www.sis.se/std-9213439075-13 Fourth edition 2016-12-15 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 9075-13:2016(E) © ISO/IEC 2016 ISO/IEC 9075-13:2016(E) This preview is downloaded from www.sis.se. Buy the entire standard via https://www.sis.se/std-921343 COPYRIGHT PROTECTED DOCUMENT © ISO/IEC 2016, Published in Switzerland All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form orthe by requester. 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 Ch. de Blandonnet 8 • CP 401 ISOCH-1214 copyright Vernier, office Geneva, Switzerland Tel. +41 22 749 01 11 Fax +41 22 749 09 47 www.iso.org [email protected] ii © ISO/IEC 2016 – All rights reserved This preview is downloaded from www.sis.se. Buy the entire standard via https://www.sis.se/std-921343 ISO/IEC 9075-13:2016(E) Contents Page Foreword. vii Introduction. viii 1 Scope. 1 2 Normative references. 3 2.1 ISO and IEC standards.
    [Show full text]
  • Java and SQLJ Versus PL/SQL
    Oracle8i SQLJ Developer’s Guide and Reference Release 3 (8.1.7) July 2000 Part No. A83723-01 SQLJ Developer’s Guide and Reference, Release 3 (8.1.7) Part No. A83723-01 Copyright © 1996, 1999, 2000 Oracle Corporation. All rights reserved. Primary Author: Brian Wright Contributing Author: Ekkehard Rohwedder Contributors: Brian Becker, Alan Thiesen, Lei Tang, Julie Basu, Pierre Dufour, Jerry Schwarz, Risto Lankinen, Cheuk Chau, Vishu Krishnamurthy, Rafiul Ahad, Jack Melnick, Tim Smith, Thomas Pfaeffle, Tom Portfolio, Ellen Barnes, Susan Kraft, Sheryl Maring, Angie Long The Programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation. If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on behalf of the U.S. Government, the following notice is applicable: Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disclosure of the Programs, including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement.
    [Show full text]