HCL-TECH-SOFTWARE / connections-automation

Deployment and upgrade automation scripts for HCL Connections 7.0 based on Ansible
Apache License 2.0
17 stars 31 forks source link

TDI install renames DB2 jdbc files in DB2 directory #186

Closed stoeps13 closed 2 years ago

stoeps13 commented 2 years ago

Why does the TDI installation rename files in DB2?

https://github.com/HCL-TECH-SOFTWARE/connections-automation/blob/d4dc1a04d57942cbe66c0e159c62357d0d40342e/roles/third_party/ibm/tdi-install/tasks/tdisol_install.yml#L93-L119

So the file is renamed in DB2/java folder and then copied to TDI. It never was necessary to do so, but it will break other things, because db2jcc.jar and db2cc4.jar are two different kinds of jdbc drivers:

The IBM Data Server Driver for JDBC and SQLJ package includes two JDBC drivers:

db2jcc.jar - This driver is based on the JDBC 3 specification (Minimum required Java version 4)
db2jcc4.jar - This driver is based on the JDBC 4 or later specifications (Minimum required Java version 6)

So you break backwards compatibility in the driver. Just let the files as installed by DB2 setup and copy db2jcc4.jar to TDI, no need to rename!

nitinjagjivan commented 2 years ago

Thanks for raising this issue. It will be fixed in the next push.

stoeps13 commented 2 years ago

The documentation tells to copy db2jcc.jar, I need to doublecheck what DB2 installs, but I normally copy db2jcc.jar, db2jcc4.jar and the lic.jar

nitinjagjivan commented 2 years ago

Thanks for the PR https://github.com/HCL-TECH-SOFTWARE/connections-automation/pull/189. I checked v11.1.4fp5_jdbc_sqlj.tar.gz where we have both the files(db2jcc4.jar and db2jcc.jar). But in v11.5.6fp5_jdbc_sqlj.tar.gz db2jcc.jar is not available. So depending on the availability we can copy db2jcc4.jar and/or db2jcc.jar. I will update the code in Jan21 release. Code snippet -

- name: "stat db2jcc4"
  stat: path="{{ __db2_jdbc_location }}/db2jcc4.jar"
  register: db2jcc4_exists

- name: "stat db2jcc"
  stat: path="{{ __db2_jdbc_location }}/db2jcc.jar"
  register: db2jcc_exists

- name: "Copy DB2 JDBC files"
  copy:
  src: "{{ __db2_jdbc_location }}/{{ item }}"
  dest: "{{ __jdbc_destination }}"
  remote_src: yes
  with_items:
    - "{{ 'db2jcc4.jar' if db2jcc4_exists.stat.exists else 'db2jcc.jar' }}"
    - "{{ 'db2jcc.jar' if db2jcc_exists.stat.exists else 'db2jcc4.jar' }}"
    - "db2jcc_license_cu.jar"
  when:
    - "'db2_servers' in groups"
nitinjagjivan commented 2 years ago

Update- db2jcc.jar is deprecated so we are upgrading to the db2jcc4.jar driver. db2jcc.jar won't be copied hereafter. link- https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads

- name: "Copy DB2 JDBC files"
  copy:
  src: "{{ __db2_jdbc_location }}/{{ item }}"
  dest: "{{ __jdbc_destination }}"
  remote_src: yes
  with_items:
    - "db2jcc4.jar"
    - "db2jcc_license_cu.jar"
  when:
    - "'db2_servers' in groups"
sabrina-yee commented 2 years ago

Addressed in Feb 2022 release.