ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzamy_5.4.0.1/50/program/dabover.htm

52 lines
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
<title>Data access JavaBeans overview</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h6><a name="dabover"></a>Data access JavaBeans overview</h6>
<p>The data access beans are located in the com.ibm.db package, and they offer these capabilities:</p>
<ul>
<li><p><strong>Caching query results</strong>
<br>You can retrieve SQL query results all at once and place them in a cache. Programs that use 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, which are subsets of the complete result set.</p></li>
<li><p><strong>Updating through result cache</strong>
<br>Programs can use standard Java statements (rather than SQL statements) to change, add, or delete rows in the result cache. You can propagate changes to the cache in the underlying relational table.</p></li>
<li><p><strong>Querying parameter support</strong>
<br>The base SQL query is defined as a Java String, with parameters that replace some of the actual values. When the query runs, the data access beans provide a way to replace the parameters with values that are made available at run time. Default mappings for common data types are provided, but you can specify whatever your Java program and database require.</p></li>
<li><p><strong>Supporting metadata</strong>
<br>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 are returned, the metadata object automatically converts SQL data types back into the Java data types that are specified in the metadata mapping.</p></li>
</ul>
<p>Data access beans are essentially a class library that makes it easier to access a database. The library contains a set of beans with methods that access the database through the JDBC API. There are several sets of classes referred to as data access beans. To make things clearer, you can refer to the classes by the name of the JAR file that contains them:</p>
<ul>
<li><p><strong>databeans.jar</strong>
<br>This JAR file ships with the WebSphere Application Server - Express. This file contains classes that enable you to access the database using the JDBC API.</p></li>
<li><p><strong>ivjdab.jar</strong>
<br>This JAR file ships with IBM Visual Age for Java. This file contains all of the classes in the databeans.jar file and classes that support easy use of the data access beans from the VisualAge for Java Visual Composition Editor.</p></li>
<li><p><strong>dbbeans.jar</strong>
<br>This JAR file ships with WebSphere Studio Site Developer (WSSD) and WebSphere Studio Application Developer (WSAD). This file contains a set of data access beans to more closely conform to the JDBC 2.0 RowSet standard. It is recommended that you develop any new data access JavaBeans applications with this package.</p></li>
</ul>
<p>The com.ibm.db package is provided to support existing applications that use data access beans. If you want to continue using applications that use the com.ibm.db package, see the Version 4.0 API documentation for <a href="apidocs/ae/com/ibm/db/package-summary.html">com.ibm.db</a>. For an example, see <a href="dabex1.htm">Example: Using WebSphere Application Server Version 4.0 data access beans</a>.</p>
<p>If you want to create new applications that use the com.ibm.db.beans package, see the WSAD documentation concerning data access beans. For an example, see <a href="dabex2.htm">Example: Using data access beans in WebSphere Application Server - Express</a>.</p>
</body>
</html>