ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzatz_5.4.0.1/51/program/dataext.htm

42 lines
4.1 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!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>IBM extensions to the data access API</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h5><a name="dataext"></a>IBM extensions to the data access API</h5>
<p>Applications can access the back end data through the standard J2EE 1.3 defined application programming interfaces (APIs). However, the standard APIs do not always provide a complete solution for an application that runs in an application server. For example, the JDBC programming model sometimes does not completely work with the J2EE Connector Architecture (JCA) Specification (even though the JCA architecture has explicitly specified that it integrates with the JDBC programming model). These gaps cause some incompatibility between the JDBC and JCA programming models.</p>
<p>When getting and using shareable connections in a global transaction, it is not valid to change a property on the connection after you obtain it. Changes can unknowingly affect other users who share the same connection.</p>
<p>The J2EE Connector Architecture (JCA) Specification supports telling the resource adapter the specific properties settings at the time you request the connection (using the getConnection method) by passing in a ConnectionSpec. The ConnectionSpec contains the necessary connection properties used to get a connection. After you obtain a connection from this environment, your application does not need to alter the properties.</p>
<p>The JDBC programming model does not have the same interface to specify the connection properties. Instead, it gets the connection first, then sets the properties on the connection. In the case of a shareable connection, changing the connection properties impacts all the connections shared with the same physical connection. </p>
<p>WebSphere Application Server - Express provides these extensions to fill in the gaps between these two specifications. </p>
<ul>
<li><p><strong>WSDataSource interface</strong>
<br>This interface extends javax.sql.DataSource, and enables a component or an application to specify the connection properties through the WebSphere Application Server - Express JDBCConnectionSpec to get a specific connection. The getConnection(JDBCConnectionSpec) method returns a specific connection which has the JCA compliant connection behavior. For more information, see <a href="apidocs/ae/com/ibm/websphere/rsadapter/WSDataSource.html">Interface WSDataSource</a> <img src="api.gif" width="18" height="15" align="absbottom" alt="Go to API documentation"> in the Javadoc.</p></li>
<li><p><strong>JDBCConnectionSpec interface</strong>
<br>This interface extends the com.ibm.websphere.rsadapter.WSConnectionSpec, which extends javax.resources.cci.ConnectionSpec. The standard ConnectionSpec interface provides only the interface marker without any get and set methods. The WSConnectionSpec and JDBCConnectionSpec define a set of get and set methods used by the WebSphere Application Server - Express run time. This interface enables the application to specify all the essential connection properties in order to get an appropriate connection. You can create this class from the WebSphere WSRRAFactory. For more information, see <a href="apidocs/ae/com/ibm/websphere/rsadapter/JDBCConnectionSpec.html">Interface JDBCConnection</a> <img src="api.gif" width="18" height="15" align="absbottom" alt="Go to API documentation"> in the Javadoc.</p></li>
<li><p><strong>WSRRAFactory</strong>
<br>This is the Relational Resource Adapter Factory which allows the user to create a JDBCConnectionSpec or other resource adapter related object. For more information, see <a href="apidocs/ae/com/ibm/websphere/rsadapter/WSRRAFactory.html">Class WSRRAFactory</a> <img src="api.gif" width="18" height="15" align="absbottom" alt="Go to API documentation"> in the Javadoc.</p></li>
</ul>
</body>
</html>