Data Access

Aspire can be used as a data access library for Java programs. Aspire has three abstractions for data access.

  1. Relational abstraction
  2. hierarchical abstraction
  3. and Data Object abstraction.

In addition Aspire has a transactional aspect that cuts across all of data abstractions.This article examines each of these abstraction while identifying their relevance

Examples of database definitions.

connection strings
aliases

http://www.onjava.com/lpt/a/2856

Use it for a very flexible data access library: Imagine retrieving and updating data without ever thinking about connections, databases, commits, rollbacks, etc. Imagine having all of your SQL externalized into config files so that it stays out of your pure Java code. Imagine swapping your data sources between flat files, SQL, stored procedures, CICS transactions, etc. Imagine also not changing your client code a bit while you are doing this. Imagine transactional capability across multiple data access components. Aspire provides all of this in a very small package.

http://www.onjava.com/lpt/a/3277

1. Retrieve a page worth of data using a single call
2. Execute multiple sql statements and combine their output into a single logical data set
3. Retrieve XML from relational databases declaratively
This article will demonstrate the following
  1. Come up with a symbolic name for your data set
  2. Create a properties file section for that symbolic name
  3. Retrieve the data set in java
  4. Example properties file for data set with only main data
  5. Example properties file for data set with a main data set and one loop
  6. Example properties file for data set with a main data set and two sibling loops
  7. Example properties file for data set with a main data set and one loop and one sub loop
Use this example if you want to see how retrieve recursive structures such as folders and files from a database.
Introduced for easily constructing objects of type IDataCollection

It is common to make use of stored procedures to encapsulate business logic that operates on data. There are fairly well documented benefits of doing this despite, also, the known drawbacks. For one thing these procedures represent a chunk of work with minimal infrstructural accoutrements. For example you don't need to worry about transactions or connections. You just write the logic. The connections and transactions are handled by the container, in this case the database.

At times a database may not support stored procedures or even when they do due to the complex nature of manipulation you may need to use the power of Java to write that logic. But when we step into java, you start needing to know about transactions and connections, statements, result sets etc.

This article shows how to imitate stored procedure like logic in Java while borrowing the same connection agnostic benefits that are inherent in stored procedures.