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

advertisement

AddThis Social Bookmark Button

SQLJ

SQLJ

SQLJ is a Java optimized query language on the server. SQLJ is being standardized by Sybase, Oracle and IBM.

DDL Statements and Transactions (ONJava.com)
Learn how to add SQLJ statements to Java programs that use the embedded SQL Data Definition Language.

Java Programming with Oracle JDBC: Performance (ONJava.com)
When it comes to JDBC performance issues, there are two major factors to consider: performance of the database structure and the SQL statements used against it and relative efficiency of the different ways you can use the JDBC interfaces to manipulate a database. This excerpt from Java Programming with Oracle JDBC explores these.

DML Statements (ONJava.com)
Learn how to add SQLJ statements to your Java programs that use embedded SQL Data Manipulation Language (DML) statements.

Database Connections and SQLJ Statements (ONJava.com)
Jason Price describes how to connect to a database and embed SQL statements in your Java programs using SQLJ.

Setting Up Your Environment to Develop SQLJ Programs (ONJava.com)
Jason Price describes how to set up your environment to develop SQLJ applications, and he demonstrates a "Hello World" program that uses SQLJ to access a database.

Learning EJB QL (ONJava.com)
Learn how the addition of EJB QL to EJB 2 justifies the distributed component architecture as the standard way of defining queries, which allows database applications to be more portable.

Java Programming with Oracle SQLJ: Contexts and Multithreading (ONJava.com)
A multithreaded program is one that is able to carry out several tasks in parallel using Java threads. As you will see in this excerpt from Java Programming with Oracle SQLJ, execution contexts are very important when writing a multithreaded SQLJ program.


Resources and links:

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. [Source: Sybase, SQLJ.org]