title: DB2 data source for a liberty java application
body: <p><br>
  I'm tring to access a DB2 data source on a remote machine, by a java web app deployed on a liberty websphere machine. In the moment the code execute the lookup ok the data source from the context the following error returns to me:</p>
  
  <pre><code>I FFDC1015I: An FFDC Incident has been created: "java.lang.ClassNotFoundException com.ibm.db2.jcc.DB2ConnectionPoolDataSource com.ibm.ws.injectionengine.processor.ResourceProcessor.loadTypeClass 1142" at ffdc_16.07.28_15.54.28.0.log"
  W CWNEN0046W: The com.ibm.db2.jcc.DB2ConnectionPoolDataSource type specified on the resource-ref, resource-env-ref, or message-destination-ref with the jdbc/db2/primadb name in the db2-webapp.war module could not be loaded. Compatibility type checking will not be performed for this resource reference.
  </code></pre>
  
  <p>1)Have some help to access the data source?<br/>
  2)Opened I opened the data source, I wuold like to open a connection and execute a prepared stateemnt on the the DB. Code here should be different from using the traditional javax.sql.Datasource?</p>
  
  <p>the relevant part of my server.xml</p>
  
  <pre><code> &lt;dataSource jndiName="jdbc/db2/primadb" type="javax.sql.DataSource"&gt;
      &lt;jdbcDriver javax.sql.DataSource="com.ibm.db2.jcc.DB2ConnectionPoolDataSource"
                  libraryRef="db2Lib"/&gt;
   &lt;properties.db2.jcc driverType="4" serverName="172.17.0.3"
                 portNumber="50000" databaseName="PRIMADB"
                 user="db2inst1" password="*****"/&gt;
  &lt;/dataSource&gt;
  
  &lt;library id="db2Lib"&gt;
      &lt;fileset dir="lib" includes="*.jar"/&gt;
  &lt;/library&gt;
   &lt;application id="db2-webapp" name="Web App DB2"&gt;
      &lt;classLoader commonLibraryRef="db2Lib"/&gt;
  &lt;/application&gt;
  </code></pre>