WAS v8.5 > WebSphere applications > Data access resources > Data concepts

Data access beans

Data access beans are Java classes written to the Enterprise JavaBeans specification that can be used in JavaBeans-compliant tools, such as the IBM Rational Application Developer.

The data access beans, in package com.ibm.db, offer the following capabilities:

Feature

Details

Caching query results

We can retrieve SQL query results all at once and place them in a cache. Programs using the result set can move forward and backward through the cache or jump directly to any result row in the cache.

For large result sets, the data access beans provide ways to retrieve and manage packets, subsets of the complete result set.

Update through result cache

Programs can use standard Java statements (rather than SQL statements) to change, add, or delete rows in the result cache. We can propagate changes to the cache in the underlying relational table.

Querying parameter support

The base SQL query is defined as a Java String, with parameters replacing some of the actual values. When the query runs, the data access beans provide a way to replace the parameters with values made available at run time. Default mappings for common data types are provided, but we can specify whatever your Java program and database require.

Supporting metadata

A StatementMetaData object contains the base SQL query. Information about the query (metadata) enables the object to pass parameters into the query as Java data types.

Metadata in the object maps Java data types to SQL data types (as well as the reverse). When the query runs, the Java-datatyped parameters are automatically converted to SQL data types as specified in the metadata mapping.

When results return, the metadata object automatically converts SQL data types back into the Java data types specified in the metadata mapping.


Reference:
Data access bean types
Data access: Resources for learning


+

Search Tips   |   Advanced Search