AspireWeb (A Java Web Project)

Welcome to Aspire Knowledge Central (AKC)

   Home   Public Library   Author Content

Choose a data format:   classic-xml   object-xml   embedded-xml   text   excel

Data Access

0) 05.01 Overview of data access using Aspire (3-Sep-03)

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

1) 05.03 Aspire database definition examples (20-May-06)

Examples of database definitions.

connection strings
aliases

2) 05.09 How to use Aspire for relational data access? (3-Sep-03)

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.

3) 05.11 How to use Aspire for Hierarchical data access? (19-Apr-06)

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

4) 05.13 Obtaining an 'ihds' data set from Aspire (4-Sep-03)

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

5) How to retrieve a tree structure from a database using Aspire HDS: An Example (14-Dec-04)

Use this example if you want to see how retrieve recursive structures such as folders and files from a database.

6) How to use ListDataCollection (23-Aug-05)

Introduced for easily constructing objects of type IDataCollection

7) How to write database procedures in Java using Aspire (10-Dec-04)

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.