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:
- Java and Object-Relational Mapping
- JDO and Object-Relational Mapping
- C++ and Object-Relational Mapping
For how to use object-relational mapping with Java application servers, see enterprise architectures using Java application servers.
More on the general topic: Object-Relational Mapping (OR Mapping) Definition
- Transparent Persistence in Object-Relational Mapping
- Transparent Persistence vs. JDBC Call-Level Interfaces
- Navigation with Object-Relational Mapping