![[8.5.5.2 or later]](../ng_v8552.gif)

Configuring JCA connection factories
You can configure connection factories that comply with Java EE Connector Architecture (JCA) specification.
About this task
Procedure
Example
Use the following example to learn how to configure resource adapters with two connection factories with unique interface class names.
In the following snippet from a ra.xml file, the MyAdapter resource adapter provides two connection factories with unique interface class names:
<connection-definition>
<config-property>
<config-property-name>ServerName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>com.vendor.adapter.ConnectionFactoryImpl</connectionfactory-impl-class>
</connection-defintion>
<connection-definition>
<config-property>
<config-property-name>ServerName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
<connectionfactory-impl-class>com.vendor.adapter.DataSourceImpl</connectionfactory-impl-class>
</connection-defintion>
The following is an example
of a server configuration for this scenario:<connectionFactory jndiName="eis/cf">
<properties.MyAdapter.ConnectionFactory serverName="localhost"/>
</connectionFactory>
<connectionFactory jndiName="jdbc/ds">
<properties.MyAdapter.DataSource serverName="localhost"/>
</connectionFactory>
Use the following example to learn how to configure resource adapters with two connection factories with unique implementation class names.
In the following snippet from a ra.xml file, the MyAdapter resource adapter provides two connection factories with unique implementation class names:
<connection-definition>
<config-property>
<config-property-name>ServerName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>com.vendor.adapter.ConnectionFactoryImpl</connectionfactory-impl-class>
</connection-defintion>
<connection-definition>
<config-property>
<config-property-name>ServerName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
<connectionfactory-interface>com.vendor.adapter.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>com.vendor.adapter.MyConnectionFactoryImpl</connectionfactory-impl-class>
</connection-defintion>
The following is an example
of a server configuration for this scenario:<connectionFactory jndiName="eis/cf1">
<properties.MyAdapter.ConnectionFactoryImpl serverName="localhost"/>
</connectionFactory>
<connectionFactory jndiName="eis/cf2">
<properties.MyAdapter.MyConnectionFactoryImpl serverName="localhost"/>
</connectionFactory>
Use the following example to learn how to configure resource adapters with two connection factories where neither the simple interface nor implementation class names are unique.
In the following snippet from a ra.xml file, the MyAdapter resource adapter provides two connection factories where neither the simple interface nor the implementation class names are unique:
<connection-definition>
<config-property>
<config-property-name>ServerName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>com.vendor.adapter.ConnectionFactoryImpl</connectionfactory-impl-class>
</connection-defintion>
<connection-definition>
<config-property>
<config-property-name>HostName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
<connectionfactory-interface>com.vendor.adapter.custom.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>com.vendor.adapter.custom.ConnectionFactoryImpl</connectionfactory-impl-class>
</connection-defintion>
The following is an example
of a server configuration for this scenario:<connectionFactory jndiName="eis/cci-cf">
<properties.MyAdapter.javax.resource.cci.ConnectionFactory serverName="localhost"/>
</connectionFactory>
<connectionFactory jndiName="eis/custom-cf">
<properties.MyAdapter.com.vendor.adapter.custom.ConnectionFactory hostName="localhost"/>
</connectionFactory>
It is possible to override the
suffixes of configuration element names. See the information about
customizing JCA configuration elements to learn how to override the
suffixes of configuration element names.