ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button


SQLJ Resource

SQLJ Overview The ANSI SQLJ standard has three parts: SQLJ Part 0: ANSI 9075, "Part 10: Object Level Bindings (SQL/OLB)" Syntax for embedding SQL calls in a Java program, similar to embedded SQL in "C", Fortran, etc. The hybrid Java/SQL program is precompiled to an equivalent pure Java program using JDBC calls. I.e. SQLJ Part 0 is equivalent to JDBC calls, with an embedded syntax. Note that the same document is referred to as "SQLJ Part 0" and as "SQL Part 10". This is just a quirk of standards naming. SQLJ Part 1: NCITS 331.1, "SQL Routines using Java" SQL extensions for calling Java static methods as SQL stored procedures and functions. SQLJ Part 2: NCITS 331.2, "SQL Types using Java" SQL extensions for using Java classes as SQL datatypes in SQL columns. I.e., SQLJ Part 0 supports SQL-in-Java, and Parts 1 & 2 support Java-in-SQL. Sybase plans for SQLJ support SQLJ Part 0 We have focussed on SQLJ Part 1 & 2 capabilities, since these add new extension capabilities to SQL. SQLJ Part 0 provides convenient syntax for calling SQL in Java. SQLJ Part 0 is functionally equivalent to JDBC calls, and it has the drawback of introducing the hybrid syntax and precompiler step into the development process. We don't yet support the Part 0 precompiler, but we are considering it for the follow-on of ASE 12.5. SQLJ Parts 1 & 2 Sybase first introduced support for using Java in SQL in the ASE 12.0 and ASA 6.0 releases. This included the following: Installing Java Jar files in the ASE/ASA servers. Calling Java static methods as SQL functions and procedures. Using Java classes as SQL datatypes. At the same time we were developing these releases, Sybase was actively participating in the SQLJ effort. We contributed our product specifications as a starting point for SQLJ Part 1 & Part 2, and served as document editor for both Parts 1 & 2. When The SQLJ Part 1 and Part 2 standards were finished, they were very similar to the Sybase features, with the following differences: Our Java support in ASA 6.0 and ASE 12.0 used Java names directly in SQL statements and declarations. The SQLJ standard instead included extensions to CREATE PROC and CREATE TYPE to allow you to specify an SQL alias name for a Java method or class. We are supporting the SQLJ CREATE PROC/FUNCTION aliases in ASE 12.5, and are considering supporting the SQLJ CREATE TYPE aliases in the subsequent release. ASA supports both the SQLJ CREATE PROC/FUNCTION and CREATE TYPE aliases. Note that this support for the SQLJ CREATE aliases is an upward compatible extension to our original Java facilities. We will support both the SQLJ CREATE aliases and the simple Java names. The choice between them is a matter of individual preference. Our initial Java support in ASA 6.0 and ASE 12.0 didn't include returning SQL-style result sets or output mode stored-procedure parameters. Both of these capabilities are now supported in ASA and in the new ASE 12.5 release.

Updated: 01/23/2001
Organization: Sybase, SQLJ.org