How to Access Data in a Relational Database

This section contains examples of how to access data in a relational database using object-relational mapping with transparent persistence. The examples show the code needed to perform the operations illustrated by the animation of transparent persistence.

The code opens a database, starts a transaction, executes a query to find a Person object named "Doug Barry," does some further processing on that object, traverses to an Address object, updates the street of the Address object, commits the transaction, and closes the database. Also see transparent persistence vs. JDBC call-level interface.

Examples of relational database access using transparent persistence can be found using the following links:

For how to use object-relational mapping with Java application servers, see enterprise architectures using Java application servers.

Related Articles

More on the general topic: Object-Relational Mapping (OR Mapping) Definition

Related Fact Book

You may use this material for your work or classes. Reprint Policy. Be sure to check the menu at the left for other articles available on this site.

The Savvy Manager's Guide

Douglas K Barry is also the author of a book that explains Web Services, service-oriented architecture, and Cloud Computing in an easy-to-understand, non-technical manner.

Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide

Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide (Second Edition)

by with David Dick

This is a guide for the savvy manager who wants to capitalize on the wave of change that is occurring with Web Services, service-oriented architecture, and—more recently—Cloud Computing. The changes wrought by these technologies will require both a basic grasp of the technologies and an effective way to deal with how these changes will affect the people who build and use the systems in our organizations. This book covers both issues. Managers at all levels of all organizations must be aware of both the changes that we are now seeing and ways to deal with issues created by those changes.