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


AddThis Social Bookmark Button


Java Data Objects (JDO), Java Database Connectivity (JDBC) and SQLJ provide important Java-based database objects or connectivity to Enterprise Information Systems (EIS), whether it be Legacy or middleware.

O'Reilly Network articles about this topic:

Don't Let Hibernate Steal Your Identity (ONJava.com)
Hibernate has one set of ideas about how to make something unique, such as using a database sequence number as an ID. But this clashes with Java's need for implementations of equals() and hashCode() that determine identity for objects, even those that haven't yet made a trip to the database and thus can't have a sequence number. James Brundege has an option that should satisfy both Hibernate and Java.

JDBC 4.0 Enhancements in Java SE 6 (ONJava.com)
Java SE 6 (aka Mustang) brings with it a new set of improvements to the JDBC API for accessing databases. Improvements include support for the RowID interface, better exception handling, annotation-based queries, and (finally!) and end to the clumsy Class.forName() system of loading database drivers. In this article, Srini Penchikala tours the major features of JDBC 4.0.

Making the Most of JDBC with WebRowSet (ONJava.com)
Database to XML and back again. If everyone's doing some or all of this, then shouldn't we write it once, get it right, and standardize? JDBC 3.0's WebRowSet offers a profound increase in power over the old ResultSet. Sharad Acharya shows you what's possible.

Using Spring with JDO and Hibernate (ONJava.com)
Everyone knows about Hibernate, but what about Java Data Objects? Both of these object-relational persistence frameworks are well supported by Spring, and in this excerpt from Spring: A Developer's Notebook, Bruce Tate and Justin Gehtland show you the advantages of each and how to integrate them with Spring.

Spring: Integrating iBATIS (ONJava.com)
iBATIS is one of the object-relational (OR) frameworks embraced by the Spring framework, and it's an ideal choice for those seeking a middle ground between full-blown OR and hand-written JDBC. In this excerpt from Spring: A Developer's Notebook, Bruce Tate and Justin Gehtland show how to integrate iBATIS with Spring.

Using Global/Distributed Transactions in Java/JDBC with Oracle Real Application Clusters (ONJava.com)
Maintaining transaction integrity, and rolling back failed steps, becomes more difficult on a cluster. One option is to move some of the load balancing decisions to your code, and accounting for which cluster nodes you're using. Sachin Shetty shows how this works in the context of an Oracle Real Application Cluster.

Hibernate Class Generation Using hbm2java (ONJava.com)
Hibernate uses mapping files to express the mapping of Java classes to database tables. In a complex project, keeping mappings in sync with your Java code can be burdensome and error-prone. Fortunately, the hbm2java tool can automate this by generating POJO classes from the mapping files. John Ferguson Smart shows how to use hbm2java with Ant and Maven, and how to customize the behavior of the generated classes.

Lightweight R/O Mapping (ONJava.com)
O/R frameworks map Java classes to database tables and SQL code. While popular, this approach is unpopular among DBAs, with the database at the mercy of an external tool. Another approach is to go the other direction: write tables and stored procedures and generate Java classes from that. Norbert Ehreke introduces Amber, a framework that embodies this approach.


Hibernate for Java SE (ONJava.com)
For many, Hibernate goes hand in hand with Java EE as part of their enterprise development strategy. But what if you need access to your data access objects outside of the EE container? Jason Lee offers some strategy for getting and using a Hibernate session from Java SE code.

iBatis DAO (ONJava.com)
The J2EE Data Access Object pattern calls for encapsulating access to a data source behind an API, giving you the freedom to change implementations or use different persistence strategies for different operations. As Sunil Patil shows, the Apache iBatis DAO framework helps you develop such a strategy.

Hibernate 3 Formulas (ONJava.com)
Hibernate's formula element has been limited in previous versions of the popular object-relational mapping framework, but in Hibernate 3, your formulas can be used in many new ways that will simplify and empower your programming. Dai Yifan shows you what's new.

Prevalence: Transparent, Fault-Tolerant Object Persistence (ONJava.com)
Want to persist your objects, with transactional integrity? You probably assume you're going to be using a database, but not so fast--for lighter uses, particularly for prototyping and testing, the idea of "prevalence" may make more sense. Jim Paterson introduces it by way of Prevayler, a popular prevalence framework.

Simple Object Persistence with the db4o Object Database (ONJava.com)
Mapping Java objects to relational databases is a difficult task, fraught with perils and gotchas. db4o dodges the issue entirely by providing an object-oriented persistence mechanism that is small, lightweight and efficient. Jim Paterson shows how it works.

Using CachedRowSet to Transfer JDBC Query Results Between Classes (ONJava.com)
JDBC developers have always needed to keep a database connection open while pulling query results. But with the CachedRowSet in J2SE 1.5, it's now possible to disconnect and then get results. Sean Eidmiller shows the advantages of this approach.

Interruptible Database Queries (ONJava.com)
Perceived performance isn't just about speed; it's also about responsiveness. And few things frustrate a user like an application that ignores user input because it's off doing something else. Slav Boleslawski introduces threading techniques to keep database queries and result retrieval from locking up an application.

SQL Database Access with DBTags (ONJava.com)
Jakarta DBTags is a custom tag library that consists of tags to access and modify a database. This tutorial explains the procedure to incorporate Apache Jakarta DBTags custom tag library tags in an example JSP.

Lisp and Java (ONJava.com)
First-class functions are a powerful feature of the Lisp programming langauge. This article describes some ways they can be used, and explores how to approximate them in Java.

Configuring JBoss 4.0 JDBC Connectivity (ONJava.com)
JBoss uses the HypersonicDB by default, but with a few configuration changes, it can use any JDBC-equipped database. Deepak Vohra shows how to use Oracle, Sybase, MySQL and other databases with JBoss.

Effective Unit Testing with DbUnit (ONJava.com)
Writing unit tests first can be impractical when your code will depend on access to a database. Enter DbUnit, which allows you to write simple XML files to fill in for the yet-to-be populated database for testing purposes.

Hibernate Your Data (ONJava.com)
Hibernate can persist any kind of Java object, manipulate a hierarchy of objects, handle collections, and work with transactions. Davor Cengija shows you how.

Stored Procedures for Java Programmers (ONJava.com)
You can build your application on top of a persistence layer such as EJB, but that's not your only option. Another alternative is stored procedures. Nic Ferrier explains how they work and why the common objection -- portability -- doesn't always apply.

Object-Relational Mapping with Apache Jakarta OJB (ONJava.com)
Object persistence is important in enterprise applications, but mapping class hierarchies to relational databases can be tricky. Enter OJB, an open source persistence framework. Charles Chan demonstrates nearly-painless techniques for saving your objects.

"Castor JDO": Simply False Advertising (ONJava.com)
This expert perspective lays it on the line: Exolab's Castor JDO product does not support the JDO standard. The use of the acronym is causing confusion in the marketplace, and flirts with a violation of Sun's Java trademark.

Using Castor JDO for SQL Mapping (ONJava.com)
An in-depth look at using Castor's marshalling engine to do data binding of Java objects to tables, rows, and columns in an SQL database.

An Introduction to JDBC, Part 3 (ONJava.com)
In part three of this four-part excerpt on JDBC from Java Enterprise in a Nutshell, learn about error handling, prepared statements, BLOBs and CLOBs.

An Introduction to JDBC, Part 2 (ONJava.com)
Part Two of this excerpt from Java Enterprise in a Nutshell focuses on database connection, statements and results.

Flawed Understanding of JDO Leads to FUD (ONJava.com)
In this scathing response to Don Bales' recent critique of Java Data Objects, David Jordan offers proof that JDO does not regard SQL as a "bad thing," yields shorter and simpler code, and is vendor-neutral.

An Introduction to JDBC, Part 1 (ONJava.com)
In this excerpt from Chapter 2 of Java Enterprise in a Nutshell, the authors introduce the JDBC architecture.

Java API Map (ONJava.com)
Is the world of Java getting a little unweildy for you? Use our Java API map and directory to track all significant Java platforms and respective Java APIs. Includes the JAX Pack and MIDlets.

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

JDO vs. Entity Beans: A Modest Proposal (ONJava.com)
The Java Data Objects (JDO) approach can replace performance-poor Entity Beans in many cases. But JDO is not enough; here's a proposal for improving Entity Beans without sacrificing their server-side power.

Database Access Using Lightweight Applets (ONJava.com)
Using lightweight applet technology, you can bring the full weight of Java's GUI capability and the advantages of client-side dynamic database access to your Web applications. Because the technology employs HTTP to communicate with a database via SqlServlet, lightweight applets perform well, yet remain small enough to have acceptable download times.

Expiring Data with Hashbelts (ONJava.com)
The final installment in this series on automatic data expiration shows that hashbelts are a new data structure that satisfies all of the requirements for data expiration.

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.

Using Java Data Objects (ONJava.com)
The JDO standard frees developers from having to worry about database operations, letting them focus on business logic. This article builds a sample address book app in JDO.

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

The Hashbelt Data Structure (ONJava.com)
William Grosso continues his Data Expiration series by focusing on the 'hashbelt' algorithm, which is a generic data structure adaptable to a wide variety of time-sensitive data problems.

Dynamic Database Access from Client-Side JavaScript (ONJava.com)
Imagine the advantages of being able to dynamically access a database from client-side JavaScript. You could dynamically query a database from JavaScript for client-side field validation, or dynamically populate a drop-down select list, to name just a few possibilities. In fact, you can do this with the help of an applet-servlet pair. This article describes the applet-servlet pair architecture and offers several sample applications.

The Debate Over Java Data Objects (ONJava.com)
The Java Data Objects spec is intended to free developers from worrying about mapping objects to databases. But not everyone thinks it's a great idea. Vendors like Thought Inc. take issue with JDO and think they have better solutions. Dion Almaer weighs in on the issues.

Introducing Automatic Data Expiration (ONJava.com)
How you choose to expire data can make the difference between an application that scales to enterprise quality and one that doesn't. In the first of this three-part series, William Grosso covers the fundamentals of data expiration, and presenting solutions of increasing functionality.

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.

Unlocking the True Power of Entity EJBs (ONJava.com)
Tyler Jewell explains the real power of entity EJBs: developers can write once and deploy many times, with each deployment customized for unique data scenarios.

Top Ten Oracle JDBC Tips (Databases DevCenter)
Java Programming with Oracle JDBC author Don Bales offers his top ten tips for squeezing performance from the Oracle JDBC.

Tuning JDBC: Measuring JDBC performance (ONJava.com)
Many Java apps are dependent on Java Database Connectivity, but how do you measure JDBC's performance, and which subsystems need optimizing?

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.

Getting Up To Date with JDBC API (ONJava.com)
Object Computing's Jeff Brown covers the JDBC 3.0 specification in its proposed final draft form, which promises to add more robust transactions by way of savepoints, a number of resource pooling enhancements, retrieval of auto-generated keys and a lot more.

Using Tomcat 4 Security Realms (ONJava.com)
In part 4 of his Using Tomcat series, James Goodwill covers Tomcat 4, focusing on security realms using both memory and JDBC realms (with a MySQL database example).

Other documents about this topic:

Below are other references available on the web for this topic. Since other sites may change their links, please if you find any that may need to be updated.

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]

Sybase White Papers/Tech Papers
Sybase White Papers, containing info on projects related to Java, JDBC, SQLJ and development for their Web Application Server. [Source: Sybase]

JDBC 2.0 Tutorial
This module introduces the fundamental concepts of JDBC and gives you a working knowledge of the major elements of the core JDBC 2.0 API. The course is standards-based and uses best practices to demonstrate How-Tos useful to the field developer. After completing this module you will understand: The rationale for the JDBC API The fundamental concepts involved in database and JDBC applications How JDBC classes work together to connect to and communicate with a database A number of intermediate-level JDBC and database concepts How to use selected capabilities new in JDBC 2.0 [Source: jGuru/Java.Sun]

Java Data Objects
JDO (Java Data Objects) is a specification for transparent persistence being developed as JSR-000012 in the Java Community Process. Transparent persistence allows developers to store their Java objects in transactional data stores "transparently", meaning that they do not need to explicitly manage the field-by-field storage and retrieval to and from the data store. [Source: theserverside.com]

This is a community site dedicated to EJB-QL or the Enterprise JavaBeans Query Language. It contains the following: * EJB-QL syntax reference * ejb-jar.xml reference * other nice things...