將 DB2 資料來源移轉至 Liberty

您可以將 DB2® 資料來源移轉至 Liberty

關於這項作業

關於WebSphere® Application Server 傳統版Liberty 中的 DB2 資料來源配置,請參閱下列程式碼範例。

範例

WebSphere Application Server 傳統版中:

<resources.jdbc:JDBCProvider xmi:id="JDBCProvider_1321914412932" 
            providerType="DB2 Using IBM JCC Driver" isolatedClassLoader="false"
            implementationClassName="com.ibm.db2.jcc.DB2ConnectionPoolDataSource" xa="false">
   <classpath>${DB2_JCC_DRIVER_PATH}/db2jcc4.jar</classpath>
   <classpath>${DB2_JCC_DRIVER_PATH}/db2jcc_license_cu.jar</classpath>
   <classpath>${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar</classpath>
   <factories xmi:type="resources.jdbc:DataSource" xmi:id="DataSource_1321914498985"
            name="DefaultDB2Datasource" jndiName="jdbc/DefaultDB2Datasource"
            providerType="DB2 Using IBM JCC Driver" authMechanismPreference="BASIC_PASSWORD"
            authDataAlias="IBM-9NE5C7ONIG4Node01/dbuser2" relationalResourceAdapter="builtin_rra"
            statementCacheSize="10"
            datasourceHelperClassname="com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper">
      <propertySet xmi:id="J2EEResourcePropertySet_1321914499000">
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499000" name="databaseName"
            type="java.lang.String" value="TESTDB" required="true" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499001" name="driverType"
            type="java.lang.Integer" value="4" required="true" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499002" name="serverName"
            type="java.lang.String" value="localhost" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499003" name="portNumber"
            type="java.lang.Integer" value="50000" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499010" name="currentLockTimeout"
            type="java.lang.Integer" value="10" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499013" name="currentSchema"
            type="java.lang.String" value="DBUSER2" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499015" name="cursorSensitivity"
            type="java.lang.Integer" value="0" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499016" name="deferPrepares"
            type="java.lang.Boolean" value="true" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499027" name="loginTimeout"
            type="java.lang.Integer" value="0" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499032"
            name="resultSetHoldability" type="java.lang.Integer" value="1" required="false"
            ignore="false" confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499034"
            name="retrieveMessagesFromServerOnGetMessage"
            type="java.lang.Boolean" value="true" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499041" name="traceLevel"
            type="java.lang.Integer" value="-1" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499052"
            name="beginTranForResultSetScrollingAPIs" type="java.lang.Boolean" value="false"
            required="false" ignore="false" confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499053"
            name="beginTranForVendorAPIs" type="java.lang.Boolean" value="false" required="false"
            ignore="false" confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499054" name="connectionSharing"
            type="java.lang.Integer" value="-1" required="false" ignore="false"
            confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499060"
            name="nonTransactionalDataSource" type="java.lang.Boolean" value="false"
            required="false" ignore="false" confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499063"
            name="syncQueryTimeoutWithTransactionTimeout" type="java.lang.Boolean" value="false"
            required="false" ignore="false" confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499069"
            name="webSphereDefaultIsolationLevel" type="java.lang.Integer" value="2"
            required="false" ignore="false" confidential="false" supportsDynamicUpdates="false"/>
         <resourceProperties xmi:id="J2EEResourceProperty_1321914499070"
            name="webSphereDefaultQueryTimeout" type="java.lang.Integer" value="10"
            required="false" ignore="false" confidential="false" supportsDynamicUpdates="false"/>
      </propertySet>
      <connectionPool xmi:id="ConnectionPool_1321914499012" connectionTimeout="180"
            maxConnections="10" minConnections="1" reapTime="180" unusedTimeout="1800"
            agedTimeout="7200" purgePolicy="EntirePool" />
      <mapping xmi:id="MappingModule_1321914681786" mappingConfigAlias=""
            authDataAlias="IBM-9NE5C7ONIG4Node01/dbuser2"/>
   </factories>
</resources.jdbc:JDBCProvider>
<systemLoginConfig xmi:id="JAASConfiguration_2">
   <authDataEntries xmi:id="auth1" alias="IBM-9NE5C7ONIG4Node01/dbuser2"
            userId="dbuser2" password="{xor}LDcfLTo7Oz0=" />
</systemLoginConfig>

Liberty 中,對等的配置如下:

<variable name="DB2_JCC_DRIVER_PATH" value="C:/Drivers/DB2" />
<library id="db2Lib">
   <fileset dir="${DB2_JCC_DRIVER_PATH}" includes="db2jcc4.jar
            db2jcc_license_cu.jar db2jcc_license_cisuz.jar" />
</library>
<dataSource id="DefaultDB2Datasource" jndiName="jdbc/DefaultDB2Datasource"
    statementCacheSize="10"
    beginTranForResultSetScrollingAPIs="false"
    beginTranForVendorAPIs="false"
    connectionSharing="MatchCurrentState"
    transactional="false"
    syncQueryTimeoutWithTransactionTimeout="false"
    isolationLevel="TRANSACTION_READ_COMMITTED"
    queryTimeout="10"
   >
   <jdbcDriver libraryRef="db2Lib"
            javax.sql.ConnectionPoolDataSource="com.ibm.db2.jcc.DB2ConnectionPoolDataSource"/>
   <properties.db2.jcc
    databaseName="TESTDB"
    driverType="4"
    serverName="localhost"
    portNumber="50000"
    currentLockTimeout="10"
    currentSchema="DBUSER2"
    cursorSensitivity="0"
    deferPrepares="true"
    loginTimeout="0"
    resultSetHoldability="1"
    retrieveMessagesFromServerOnGetMessage="true"
    traceLevel="-1"
    user="dbuser2"
    password="{xor}LDcfLTo7Oz0="
   />
   <connectionManager connectionTimeout="180" maxPoolSize="10" minPoolSize="1" reapTime="180"
            maxIdleTime="1800" agedTimeout="7200" purgePolicy="EntirePool"/>
</dataSource>

指示主題類型的圖示 作業主題

檔名:twlp_migrate_ds_db2.html