From 9ac039fad3e35a5fd61822efde72f6a10b949b93 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Wed, 9 Apr 2025 16:59:37 +0100 Subject: [PATCH 1/8] fixes --- .../src/main/resources/META-INF/MANIFEST.MF | 4 ++-- .../src/main/bundleParts/JODB.transaction | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF b/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF index a00f500..8c1fca1 100644 --- a/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF +++ b/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF @@ -4,6 +4,6 @@ Bundle-Name: CICS OSGi JDBC application - Application Bundle-SymbolicName: com.ibm.cicsdev.java.osgi.jdbc Bundle-Version: 1.0.0 Import-Package: com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0", - com.ibm.cics.server;version="[1.700.0,2.0.0)" + com.ibm.cics.server;version="[1.700.0,2.0.0)",com.ibm.db2.jcc Export-Package: com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0" -CICS-MainClass: com.ibm.cicsdev.java.osgi.jdbc.JDBCQueryProgram \ No newline at end of file +CICS-MainClass: com.ibm.cicsdev.java.osgi.jdbc.JDBCQueryProgram diff --git a/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction b/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction index b4a880b..046cb90 100644 --- a/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction +++ b/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction @@ -1,3 +1,3 @@ - \ No newline at end of file From b689d743525b81f7a04e8288a81d9b10303de091 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 10 Apr 2025 10:34:00 +0100 Subject: [PATCH 2/8] use new copyright action and readme update --- .github/workflows/java.yml | 26 ++------ README.md | 103 +++++++++++++++++++++++------ etc/jvmprofiles/DFHOSGI.jvmprofile | 2 +- 3 files changed, 92 insertions(+), 39 deletions(-) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index b9b9403..e95dd46 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -10,29 +10,17 @@ on: jobs: check-copyright: - name: Check Copyright runs-on: ubuntu-latest + name: Check Copyright steps: - - uses: actions/checkout@v3 - - - name: Check Copyright - env: - EXTENSIONS: "*.java" - COPYRIGHT_STATEMENT: "/**\n * Copyright IBM Corp. 2025\n */" - run: | - for ext in $EXTENSIONS; do - for file in $(find . -type f -name "$ext" ! -path "cics-java-osgi-jdbc-app/*"); do - if ! grep -q "Copyright" "$file"; then - echo -e "$COPYRIGHT_STATEMENT\n$(cat "$file")" > "$file" - fi - done - done - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 + - uses: actions/checkout@v4 + - id: copyright-action + uses: cicsdev/.github/.github/actions/samples-copyright-checker@139edd8dc23af7f4f7dd9afe4d56a1053fe426a7 with: + directory: './cics-java-osgi-jdbc-app/' + file-extensions: '*.java' + base-copyright: 'Copyright IBM Corp. 2025' token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ github.head_ref }} build-mvnw: name: Build Maven Wrapper diff --git a/README.md b/README.md index 9fbd2ee..416c4ae 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The application makes use of the employee sample table supplied with Db2 for z/O ## Requirements * CICS TS V5.5 or later -* A connected CICS DB2CONN resource. For more information, see [Deploying](#deploying) +* A connected CICS DB2CONN resource. For more information, see [DB2CONN](#cics-db2conn-connection) * An OSGi JVM server * Java SE 1.8 or later on the workstation * IBM Db2 V11 or later on z/OS @@ -71,9 +71,58 @@ mvn clean verify -Dcics.jvmserver=MYJVM ``` ## Deploying -Configure the JVM profile of the OSGi JVM server to include the Db2 driver JARs in the `OSGI_BUNDLES` environment variable and the Db2 library in the `LIBRARY_SUFFIX` environment variable. For more information, see the provided [JVM profile template](etc/jvmprofiles/DFHOSGI.jvmprofile). If necessary, restart the JVM server. +### Configure CICS JCL +To allow your CICS region to connect to DB2, we need to add some configuration to the JCL. -Ensure a CICS DB2CONN is installed and connected. +``` +// SET DB2=V12 - DB2 Version +... + +... +DB2CONN=YES +//STEPLIB +... +// DD DISP=SHR,DSN=SYS2.DB2.&DB2..SDSNLOAD +// DD DISP=SHR,DSN=SYS2.DB2.&DB2..SDSNLOD2 +// DD DISP=SHR,DSN=DSN&DB2.P2.RUNLIB.LOAD +``` + +### Configure the JVM Profile +Configure the JVM profile of the OSGi JVM server to include the Db2 driver JARs in the `OSGI_BUNDLES` environment variable and the Db2 library in the `LIBRARY_SUFFIX` environment variable. + +> Note: The same of your JVM profile MUST be DFHOSGI +``` +DB2_PATH=/usr/lpp/db2v12 +OSGI_BUNDLES=&DB2_PATH;/jdbc/classes/db2jcc4.jar,\ + &DB2_PATH;/jdbc/classes/db2jcc_license_cisuz.jar +LIBPATH_SUFFIX=&DB2_PATH;/jdbc/lib +``` +>Note: This example is using db2v12, this version must be consistent to the version set in your JCL. +As an example, see the provided [JVM profile template](etc/jvmprofiles/DFHOSGI.jvmprofile). If necessary, restart the JVM server. + +--- + +### CICS DB2CONN Connection + +Ensure a CICS DB2CONN is installed and connected. + +``` +CEDA DEFINE DB2CONN(JODBCONN) GROUP(CDEVJODB) +``` +``` +CEDA INSTALL DB2CONN(CDEVJODB) GROUP(CDEVJODB) +``` + +### CICS DB2CONN Connection with CICS Explorer +1. Definitions > Db2 > Db2 Connection Definitions +2. Right-click > New... +3. Fill in the Name and Group with `CDEVJODB` +4. Right-click and install the new definition +5. Ensure it is CONNECTED + +> Note: The DB2ID differs between DB2 versions and the system you are running your CICS region on. For example, DB2V12 on plex2c, the DB2ID would be DK2C. + +--- ### Deploying using command line tools 1. Upload the built CICS bundle ZIP file from your *projects/cics-java-osgi-jdbc-bundle/target* or *projects/cics-java-osgi-jdbc-bundle/build/distributions* directory to z/FS on the host system (e.g. FTP). @@ -91,35 +140,51 @@ Ensure a CICS DB2CONN is installed and connected. 2. Create a new OSGi bundlepart that references the JAR file. 3. Deploy the CICS bundle project from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. +### Deploying using CICS Explorer and CICS Bundle ZIP +1. Connect to USS on the host system (e.g. SSH). +2. Create the bundle directory for the project. +3. Copy & paste the built CICS bundle ZIP file from your *projects/cics-java-osgi-jdbc-bundle/target* or *projects/cics-java-osgi-jdbc-bundle/build/distributions* directory to z/FS on the host system into the bundle directory. +4. Extract ther ZIP by right-clicking on the ZIP file > User Action > unjar... +5. Refresh the bundle directory + +--- + ### Installing the bundle 1. Create a new bundle definition, setting the bundle directory to the deployed bundle directory: ``` - BUNDLE(CDEVJODB) GROUP(CICSDEV) BUNDLEDIR(/path/to/bundle/directory) + BUNDLE(CDEVJODB) GROUP(CDEVJODB) BUNDLEDIR(/path/to/bundle/directory) ``` 2. Install the bundle +### Installing the bundle with CICS Explorer +1. Definitions > Bundle Definitions +2. Right-click > New... +3. Fill in the Bundle and Group names as `CDEVJODB` +4. Fill in the Bundle Directory to point to the directory you expanded the ZIP +5. Install the bundle + ## Running To run the sample, run the transaction `JODB`. The terminal should contain contents similar to the following: ``` -JODB -000001 BILBO BAGGINS 2004.00 -000010 CHRISTINE HAAS 52750.00 -000020 MICHAEL THOMPSON 41250.00 -000030 SAL KWAN 38250.00 -000050 JOHN GEYER 40175.00 -000060 IRVING STERN 32250.00 -000070 EVA PULASKI 36170.00 -000090 EILEEN HENDERSON 29750.00 -000100 THEODORE SPENSER 26150.00 -000110 VINCENZO LUCCHESI 46500.00 -000120 SEAN O'CONNELL 29250.00 -000130 DOLORES QUINTANA 23800.00 -000140 HEATHER NICHOLLS 28420.00 +JODB +000001 BILBO BAGGINS 2004.00 +000010 CHRISTINE HAAS 90.00 +000020 MICHAEL THOMPSON 41250.00 +000030 SAL KWAN 38250.00 +000050 JOHN GEYER 40175.00 +000060 IRVING STERN 32250.00 +000070 EVA PULASKI 36170.00 +000090 EILEEN HENDERSON 29750.00 +000100 THEODORE SPENSER 26150.00 +000110 VINCENZO LUCCHESI 46500.00 +000111 TES TEST 1000000.00 +000120 SEAN O'CONNELL 29250.00 +000130 DOLORES QUINTANA 23800.00 +000140 HEATHER NICHOLLS 28420.00 000150 BRUCE ADAMSON 25280.00 -000160 ELIZABETH PIANKA 22250.00 ``` The actual contents will be based on the values in the `EMP` table in the database. diff --git a/etc/jvmprofiles/DFHOSGI.jvmprofile b/etc/jvmprofiles/DFHOSGI.jvmprofile index 2a5b0ca..e598b87 100644 --- a/etc/jvmprofiles/DFHOSGI.jvmprofile +++ b/etc/jvmprofiles/DFHOSGI.jvmprofile @@ -28,7 +28,7 @@ WORK_DIR=. _BPXK_DISABLE_SHLIB=YES # Db2 paths -DB2_PATH=/usr/lpp/db2v13 +DB2_PATH=/usr/lpp/db2v12 OSGI_BUNDLES=&DB2_PATH;/jdbc/classes/db2jcc4.jar,\ &DB2_PATH;/jdbc/classes/db2jcc_license_cisuz.jar LIBPATH_SUFFIX=&DB2_PATH;/jdbc/lib From a7c6bd690bd067f6fc547868b4cddde4058233d3 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Wed, 7 May 2025 16:24:41 +0100 Subject: [PATCH 3/8] first part to fix and refactor 5.5 branch --- .project | 2 +- .settings/org.eclipse.buildship.core.prefs | 13 +++++++++++++ .settings/org.eclipse.core.resources.prefs | 2 ++ .settings/org.eclipse.jdt.core.prefs | 15 +++++++++++++++ cics-java-osgi-jdbc-app/.project | 12 ++++++++++++ .../org.eclipse.buildship.core.prefs | 13 +++++++++++++ .../org.eclipse.core.resources.prefs | 1 - .../.settings/org.eclipse.jdt.apt.core.prefs | 3 +++ .../.settings/org.eclipse.jdt.core.prefs | 14 ++++++++++---- .../main/resources => }/META-INF/MANIFEST.MF | 2 +- cics-java-osgi-jdbc-app/build.gradle | 19 ++++++++++++++++++- cics-java-osgi-jdbc-app/build.properties | 5 +++++ cics-java-osgi-jdbc-app/pom.xml | 2 +- .../org.eclipse.buildship.core.prefs | 13 +++++++++++++ .../org.eclipse.ltk.core.refactoring.prefs | 2 ++ .../org.eclipse.core.resources.prefs | 4 ++++ etc/eclipse_projects/JODB.transaction | 3 +++ etc/eclipse_projects/META-INF/cics.xml | 8 ++++++++ .../cics-java-osgi-jdbc-app-1.0.0.osgibundle | 2 ++ pom.xml | 2 +- settings.gradle | 2 +- 21 files changed, 128 insertions(+), 11 deletions(-) create mode 100644 .settings/org.eclipse.buildship.core.prefs create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 cics-java-osgi-jdbc-app/.settings/org.eclipse.buildship.core.prefs rename cics-java-osgi-jdbc-app/{src/main/resources => }/META-INF/MANIFEST.MF (81%) create mode 100644 cics-java-osgi-jdbc-app/build.properties create mode 100644 cics-java-osgi-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs create mode 100644 cics-java-osgi-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs create mode 100644 etc/eclipse_projects/JODB.transaction create mode 100644 etc/eclipse_projects/META-INF/cics.xml create mode 100644 etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle diff --git a/.project b/.project index 847ce13..844205e 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - cics-java-osgi-link + cics-java-osgi-jdbc diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..9a46653 --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir=cics-java-osgi-jdbc-app +eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false \ No newline at end of file diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..896a9a5 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 \ No newline at end of file diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..a361f77 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 \ No newline at end of file diff --git a/cics-java-osgi-jdbc-app/.project b/cics-java-osgi-jdbc-app/.project index 0664f9e..e4f49e0 100644 --- a/cics-java-osgi-jdbc-app/.project +++ b/cics-java-osgi-jdbc-app/.project @@ -1,6 +1,7 @@ cics-java-osgi-jdbc-app + @@ -19,10 +20,21 @@ + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature org.eclipse.buildship.core.gradleprojectnature + org.eclipse.pde.PluginNature diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.buildship.core.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..60b1463 --- /dev/null +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir= +eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false \ No newline at end of file diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs index abdea9a..e9441bb 100644 --- a/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,3 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 encoding/=UTF-8 diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs index d4313d4..27769d2 100644 --- a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs @@ -1,2 +1,5 @@ eclipse.preferences.version=1 org.eclipse.jdt.apt.aptEnabled=false +org.eclipse.jdt.apt.genSrcDir=.apt_generated +org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests +org.eclipse.jdt.apt.reconcileEnabled=true \ No newline at end of file diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs index 1b6e1ef..a361f77 100644 --- a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,15 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.source=1.8 \ No newline at end of file diff --git a/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF b/cics-java-osgi-jdbc-app/META-INF/MANIFEST.MF similarity index 81% rename from cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF rename to cics-java-osgi-jdbc-app/META-INF/MANIFEST.MF index 8c1fca1..abb31f8 100644 --- a/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF +++ b/cics-java-osgi-jdbc-app/META-INF/MANIFEST.MF @@ -4,6 +4,6 @@ Bundle-Name: CICS OSGi JDBC application - Application Bundle-SymbolicName: com.ibm.cicsdev.java.osgi.jdbc Bundle-Version: 1.0.0 Import-Package: com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0", - com.ibm.cics.server;version="[1.700.0,2.0.0)",com.ibm.db2.jcc + com.ibm.cics.server;version="[1.700.0,2.0.0)",com.ibm.db2.jcc;resolution:=optional Export-Package: com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0" CICS-MainClass: com.ibm.cicsdev.java.osgi.jdbc.JDBCQueryProgram diff --git a/cics-java-osgi-jdbc-app/build.gradle b/cics-java-osgi-jdbc-app/build.gradle index f0d1c76..2532fa9 100644 --- a/cics-java-osgi-jdbc-app/build.gradle +++ b/cics-java-osgi-jdbc-app/build.gradle @@ -1,5 +1,22 @@ plugins { id 'java' + id 'eclipse' +} + +java +{ + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + + +// If in Eclipse, add Javadoc to the local project classpath +eclipse +{ + classpath + { + downloadJavadoc = true + } } dependencies { @@ -11,6 +28,6 @@ description = 'CICS OSGi JDBC application - OSGi bundle' jar { manifest { - from "src/main/resources/META-INF/MANIFEST.MF" + from "META-INF/MANIFEST.MF" } } diff --git a/cics-java-osgi-jdbc-app/build.properties b/cics-java-osgi-jdbc-app/build.properties new file mode 100644 index 0000000..8a64730 --- /dev/null +++ b/cics-java-osgi-jdbc-app/build.properties @@ -0,0 +1,5 @@ +in.includes = META-INF/,\ + . +source.. = src/main/java/ +jre.compilation.profile = JavaSE-1.8 +output.. = bin/ \ No newline at end of file diff --git a/cics-java-osgi-jdbc-app/pom.xml b/cics-java-osgi-jdbc-app/pom.xml index cb5b5df..c346659 100644 --- a/cics-java-osgi-jdbc-app/pom.xml +++ b/cics-java-osgi-jdbc-app/pom.xml @@ -29,7 +29,7 @@ 3.3.0 - src/main/resources/META-INF/MANIFEST.MF + META-INF/MANIFEST.MF diff --git a/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..c566794 --- /dev/null +++ b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir=../cics-java-osgi-jdbc-app +eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false \ No newline at end of file diff --git a/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 0000000..243b3fd --- /dev/null +++ b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false \ No newline at end of file diff --git a/etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs b/etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..ab62e7f --- /dev/null +++ b/etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//META-INF/cics.xml=UTF-8 +encoding/=UTF-8 +encoding/cics-java-osgi-jdbc-app.osgibundle=UTF-8 \ No newline at end of file diff --git a/etc/eclipse_projects/JODB.transaction b/etc/eclipse_projects/JODB.transaction new file mode 100644 index 0000000..046cb90 --- /dev/null +++ b/etc/eclipse_projects/JODB.transaction @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/etc/eclipse_projects/META-INF/cics.xml b/etc/eclipse_projects/META-INF/cics.xml new file mode 100644 index 0000000..11bb5ba --- /dev/null +++ b/etc/eclipse_projects/META-INF/cics.xml @@ -0,0 +1,8 @@ + + + + 2025-05-07T16:00:33.839+01:00 + + + + diff --git a/etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle b/etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle new file mode 100644 index 0000000..9da08a6 --- /dev/null +++ b/etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle @@ -0,0 +1,2 @@ + + diff --git a/pom.xml b/pom.xml index 1a71c52..318a501 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ DFHOSGI - 8 + 1.8 UTF-8 diff --git a/settings.gradle b/settings.gradle index 29cbed0..50986e3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,3 @@ -rootProject.name = 'cics-java-osgi-link' +rootProject.name = 'cics-java-osgi-jdbc' include(':cics-java-osgi-jdbc-bundle') include(':cics-java-osgi-jdbc-app') \ No newline at end of file From 53af101c5ac0fc88e07d358d611ab71f6c4e9d0e Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Wed, 7 May 2025 17:13:04 +0100 Subject: [PATCH 4/8] more changes --- .../.settings/org.eclipse.core.resources.prefs | 2 +- etc/eclipse_projects/CDEVJODB.program | 4 ++++ etc/eclipse_projects/META-INF/cics.xml | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 etc/eclipse_projects/CDEVJODB.program diff --git a/etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs b/etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs index ab62e7f..8356e5a 100644 --- a/etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs +++ b/etc/eclipse_projects/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,4 @@ eclipse.preferences.version=1 encoding//META-INF/cics.xml=UTF-8 encoding/=UTF-8 -encoding/cics-java-osgi-jdbc-app.osgibundle=UTF-8 \ No newline at end of file +encoding/cics-java-osgi-jdbc-app.osgibundle=UTF-8 diff --git a/etc/eclipse_projects/CDEVJODB.program b/etc/eclipse_projects/CDEVJODB.program new file mode 100644 index 0000000..6d46b2e --- /dev/null +++ b/etc/eclipse_projects/CDEVJODB.program @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/etc/eclipse_projects/META-INF/cics.xml b/etc/eclipse_projects/META-INF/cics.xml index 11bb5ba..f79de77 100644 --- a/etc/eclipse_projects/META-INF/cics.xml +++ b/etc/eclipse_projects/META-INF/cics.xml @@ -1,8 +1,9 @@ - + - 2025-05-07T16:00:33.839+01:00 + 2025-05-07T15:46:32.498Z - + + From 874836d489d3f50ec998db561e472b5c0a9640ce Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 8 May 2025 12:46:30 +0100 Subject: [PATCH 5/8] fix gitignore and re-add missing files --- .gitignore | 8 ++++---- cics-java-osgi-jdbc-app/.classpath | 12 +++++++++++ etc/eclipse_projects/.project | 33 ++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 cics-java-osgi-jdbc-app/.classpath create mode 100644 etc/eclipse_projects/.project diff --git a/.gitignore b/.gitignore index 8d5da33..313dbb0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,15 +13,15 @@ buildNumber.properties # Eclipse m2e generated files # Eclipse Core -.project +#.project # JDT-specific (Eclipse Java Development Tools) -.classpath +#.classpath # Eclipse Gradle plugin generated files # Eclipse Core -.project +#.project # JDT-specific (Eclipse Java Development Tools) -.classpath +#.classpath # Java ignores diff --git a/cics-java-osgi-jdbc-app/.classpath b/cics-java-osgi-jdbc-app/.classpath new file mode 100644 index 0000000..560656a --- /dev/null +++ b/cics-java-osgi-jdbc-app/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/etc/eclipse_projects/.project b/etc/eclipse_projects/.project new file mode 100644 index 0000000..c37d970 --- /dev/null +++ b/etc/eclipse_projects/.project @@ -0,0 +1,33 @@ + + + com.ibm.cics.server.examples.osgi.jdbc.bundle + + + + + + com.ibm.cics.bundle.ui.bundlebuilder + + + bundleID + com.ibm.cics.server.examples.osgi.jdbc.bundle + + + majorVersion + + + + microVersion + + + + minorVersion + + + + + + + com.ibm.cics.bundle.ui.bundlenature + + \ No newline at end of file From 18a22472a3fc8291e9fba742587940c6a2487d85 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 8 May 2025 16:20:06 +0100 Subject: [PATCH 6/8] fixes --- cics-java-osgi-jdbc-app/build.properties | 2 +- .../src/main/bundleParts/CDEVJODB.program | 2 +- etc/eclipse_projects/CDEVJODB.program | 2 +- etc/eclipse_projects/META-INF/cics.xml | 2 +- etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cics-java-osgi-jdbc-app/build.properties b/cics-java-osgi-jdbc-app/build.properties index 8a64730..f3e45ff 100644 --- a/cics-java-osgi-jdbc-app/build.properties +++ b/cics-java-osgi-jdbc-app/build.properties @@ -1,4 +1,4 @@ -in.includes = META-INF/,\ +bin.includes = META-INF/,\ . source.. = src/main/java/ jre.compilation.profile = JavaSE-1.8 diff --git a/cics-java-osgi-jdbc-bundle/src/main/bundleParts/CDEVJODB.program b/cics-java-osgi-jdbc-bundle/src/main/bundleParts/CDEVJODB.program index 6d46b2e..dd4ea83 100644 --- a/cics-java-osgi-jdbc-bundle/src/main/bundleParts/CDEVJODB.program +++ b/cics-java-osgi-jdbc-bundle/src/main/bundleParts/CDEVJODB.program @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/etc/eclipse_projects/CDEVJODB.program b/etc/eclipse_projects/CDEVJODB.program index 6d46b2e..dd4ea83 100644 --- a/etc/eclipse_projects/CDEVJODB.program +++ b/etc/eclipse_projects/CDEVJODB.program @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/etc/eclipse_projects/META-INF/cics.xml b/etc/eclipse_projects/META-INF/cics.xml index f79de77..134bff6 100644 --- a/etc/eclipse_projects/META-INF/cics.xml +++ b/etc/eclipse_projects/META-INF/cics.xml @@ -1,5 +1,5 @@ - + 2025-05-07T15:46:32.498Z diff --git a/etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle b/etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle index 9da08a6..c4b0a2e 100644 --- a/etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle +++ b/etc/eclipse_projects/cics-java-osgi-jdbc-app-1.0.0.osgibundle @@ -1,2 +1,2 @@ - - + + From 5d4fd2ddb21734bd796e3aacde58a41f10e7cabe Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 8 May 2025 17:28:50 +0100 Subject: [PATCH 7/8] readme updates --- README.md | 131 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 91 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 416c4ae..92ed83e 100644 --- a/README.md +++ b/README.md @@ -1,76 +1,117 @@ # cics-java-osgi-jdbc -This sample demonstrates an OSGi JDBC application integrated with IBM CICS that can be deployed to a CICS OSGi JVM server. +[![Build](https://github.com/cicsdev/cics-java-osgi-jdbc/actions/workflows/java.yaml/badge.svg?branch=cicsts/v5.5)](https://github.com/cicsdev/cics-java-osgi-jdbc/actions/workflows/java.yaml) + +This sample demonstrates how to code, build, and deploy a CICS Java OSGi application that makes JDBC calls to Db2. It makes use of the employee sample table supplied with Db2 for z/OS, and allows you to display employee information from the table EMP. -The application makes use of the employee sample table supplied with Db2 for z/OS. The application allows you to display employee information from the table EMP. The sample also provides a set of Gradle and Maven build files for use either in Eclipse or standalone build environments. ## Requirements * CICS TS V5.5 or later -* A connected CICS DB2CONN resource. For more information, see [DB2CONN](#cics-db2conn-connection) +* A connected CICS DB2CONN resource. For more information, see [CONFIGURING](#configuring) * An OSGi JVM server * Java SE 1.8 or later on the workstation * IBM Db2 V11 or later on z/OS -* An Eclipse development environment on the workstation (optional) -* Either Gradle or Apache Maven on the workstation (optional if using Wrappers) + +## Downloading + +- Clone the repository using your IDEs support, such as the Eclipse Git plugin +- **or**, download the sample as a [ZIP](https://github.com/cicsdev/cics-java-osgi-jdbc/archive/cicsts/v6.1.zip) and unzip onto the workstation + +> [!TIP] +> Eclipse Git provides an 'Import existing Projects' check-box when cloning a repository. + +--- ## Building -You can build the sample using an IDE of your choice, or you can build it from the command line. For both approaches, using the supplied Gradle or Maven wrappers will give a consistent version of build tooling. +The sample includes an Eclipse project configuration, a Gradle build, a Maven POM, and Gradle/Maven Wrappers offering a wide range of build options with the tooling and IDE of your choice. -For an IDE, taking Eclipse as an example, the plug-ins for Gradle *buildship* and Maven *m2e* will integrate with the "Run As..." capability, allowing you to specify whether you want to build the project with a Wrapper, or a specific version of your chosen build tool. +Choose from the following approach: +* Use the built-in Eclipse and CICS Explorer SDK capability +* Use Eclipse with Buildship (Gradle), or m2e (Maven) to drive Gradle, or Maven. +* Use the command line, or IDE terminal, to drive Gradle or Apache Maven (if installed on your workstation) +* Use the command line, or IDE terminal, or IDE support for Wrappers, to drive the supplied Gradle or Apache Maven Wrappers (with no requirement for Gradle, Maven, Eclipse, or CICS Explorer SDK to be installed) -**Note:** If you import the project to your IDE, you might experience local project compile errors. To resolve these errors you should run a tooling refresh on that project. -For example, in Eclipse: -* for Gradle, right-click on "Project", select "Gradle -> Refresh Gradle Project", -* for Maven, right-click on "Project", select "Maven -> Update Project...". -> Tip: *In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update.* +** Note: ** If you import the project to your IDE, you might experience local project compile errors. To resolve these errors follow the relevant build section below. -### Building with Gradle -A JAR file is created inside the `cics-java-osgi-jdbc-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/build/distributions` directory. +### Option 1 - Building with Eclipse + +The sample comes pre-configured for use with a standard JDK 1.8 and the CICS TS V5.5 Java EE 6/7 Target Platform. When you initially import the project to your IDE, if your IDE is not configured for a JDK 1.8, or does not have CICS Explorer SDK installed with the correct 'target platform' set, you might experience local project compile errors. + +To resolve issues: +* ensure you have the CICS Explorer SDK plug-in installed +* configure the Project's build-path, and Application Project settings to use your preferred JDK and Java compiler settings +* set the CICS TS Target Platform to your intended CICS target (Hint: Window | Preferences | Plug-in Development | Target Platform | Add | Template | Other...) + + +### Option 2 - Building with Gradle + +You don't necessarily need to fix the local errors, but to do so, you can run a tooling refresh on the cics-java-osgi-jdbc-app project. For example, in Eclipse: right-click on "Project", select "Gradle | Refresh Gradle Project". + +The CICS JVM server name should be modified in the `cics.jvmserver` property in the gradle build [cics-java-osgi-jdbc-bundle/build.gradle](cics-java-osgi-jdbc-bundle/build.gradle) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line (see below). -If using the CICS bundle ZIP, the CICS JVM server name should be modified in the `cics.jvmserver` property in the gradle build [cics-java-osgi-jdbc-bundle/build.gradle](cics-java-osgi-jdbc-bundle/build.gradle) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line. +If you have the Gradle buildship plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-jdbc project to configure and run the `clean` and `build` tasks. Otherwise choose from the command-line approaches. **Gradle Wrapper (Linux/Mac):** ```shell ./gradlew clean build ``` + **Gradle Wrapper (Windows):** ```shell gradle.bat clean build ``` + **Gradle (command-line):** ```shell gradle clean build ``` + **Gradle (command-line & setting jvmserver):** ```shell gradle clean build -Pcics.jvmserver=MYJVM ``` -### Building with Apache Maven +A JAR file is created inside the `cics-java-osgi-jdbc-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/build/distributions` directory. -A JAR file is created inside the `cics-java-osgi-jdbc-app/target` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/target` directory. -If building a CICS bundle ZIP the CICS bundle plugin bundle-war goal is driven using the maven verify phase. The CICS JVM server name should be modified in the `` property in the [`pom.xml`](pom.xml) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line. +### Option 3 - Building with Apache Maven + +You don't necessarily need to fix the local errors, but to do so, you can run a tooling refresh on the cics-java-osgi-jdbc-app project. For example, in Eclipse: right-click on "Project", select "Maven -> Update Project...". + +> [!TIP] +> In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle or with the CICS Explorer SDK Java Libraries, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update. + +The CICS JVM server name should be modified in the `` property in the [`pom.xml`](pom.xml) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line (see below). + +If you have the Maven m2e plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-jdbc project to configure and run the `clean` and `verify` tasks. Otherwise choose from the command-line approaches. **Maven Wrapper (Linux/Mac):** ```shell ./mvnw clean verify ``` + **Maven Wrapper (Windows):** ```shell mvnw.cmd clean verify ``` + **Maven (command-line):** ```shell mvn clean verify ``` + **Maven (command-line & setting jvmserver):** ```shell mvn clean verify -Dcics.jvmserver=MYJVM ``` -## Deploying +A JAR file is created inside the `cics-java-osgi-jdbc-app/target` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/target` directory. + +--- + + +## Configuring ### Configure CICS JCL To allow your CICS region to connect to DB2, we need to add some configuration to the JCL. @@ -90,7 +131,7 @@ DB2CONN=YES ### Configure the JVM Profile Configure the JVM profile of the OSGi JVM server to include the Db2 driver JARs in the `OSGI_BUNDLES` environment variable and the Db2 library in the `LIBRARY_SUFFIX` environment variable. -> Note: The same of your JVM profile MUST be DFHOSGI +> Note: The name of your JVM profile is assumed to be 'DFHOSGI' but can be changed in your Maven/Gradle build files ``` DB2_PATH=/usr/lpp/db2v12 OSGI_BUNDLES=&DB2_PATH;/jdbc/classes/db2jcc4.jar,\ @@ -100,9 +141,7 @@ LIBPATH_SUFFIX=&DB2_PATH;/jdbc/lib >Note: This example is using db2v12, this version must be consistent to the version set in your JCL. As an example, see the provided [JVM profile template](etc/jvmprofiles/DFHOSGI.jvmprofile). If necessary, restart the JVM server. ---- - -### CICS DB2CONN Connection +### Option 1 - Configure the DB2CONN with CEDA at a terminal Ensure a CICS DB2CONN is installed and connected. @@ -113,18 +152,38 @@ CEDA DEFINE DB2CONN(JODBCONN) GROUP(CDEVJODB) CEDA INSTALL DB2CONN(CDEVJODB) GROUP(CDEVJODB) ``` -### CICS DB2CONN Connection with CICS Explorer +### Option 2 - Configure the DB2CONN with CICS Explorer 1. Definitions > Db2 > Db2 Connection Definitions 2. Right-click > New... 3. Fill in the Name and Group with `CDEVJODB` 4. Right-click and install the new definition 5. Ensure it is CONNECTED -> Note: The DB2ID differs between DB2 versions and the system you are running your CICS region on. For example, DB2V12 on plex2c, the DB2ID would be DK2C. +> Note: The DB2ID differs between DB2 versions and the system you are running your CICS region on. Consult your CICS system programmer if you are unsure. --- -### Deploying using command line tools +## Deploying to CICS +### Option 1 - Deploying using CICS Explorer SDK and the provided CICS bundle project +1. Deploy the CICS bundle project 'com.ibm.cics.server.examples.osgi.jdbc.bundle' from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. This CICS bundle includes the osgi bundlepart, the JODB transaction and the CDEVJODB program to run the sample. + + +### Option 2 - Deploying using CICS Explorer SDK with own CICS bundle project +1. Copy and paste the built JAR from your *projects/cics-java-osgi-jdbc-app/target* or *projects/cics-java-osgi-jdbc-app/build/libs* directory into a new Eclipse CICS bundle project. +2. Create a new OSGi bundlepart that references the JAR (OSGi bundle) file. +3. Optionally customise the CICS bundle contents, perhaps adding a TRANDEF of your choice +4. Right click using the ** Export Bundle Project to z/OS UNIX File System ** wizard. + + +### Option 3 - Deploying using CICS Explorer (Remote System Explorer) and CICS Bundle ZIP +1. Connect to USS on the host system +2. Create the bundle directory for the project. +3. Copy & paste the built CICS bundle ZIP file from your *projects/cics-java-osgi-jdbc-bundle/target* or *projects/cics-java-osgi-jdbc-bundle/build/distributions* directory to z/FS on the host system into the bundle directory. +4. Extract the ZIP by right-clicking on the ZIP file > User Action > unjar... +5. Refresh the bundle directory + + +### Option 4 - Deploying using command line tools 1. Upload the built CICS bundle ZIP file from your *projects/cics-java-osgi-jdbc-bundle/target* or *projects/cics-java-osgi-jdbc-bundle/build/distributions* directory to z/FS on the host system (e.g. FTP). 2. Connect to USS on the host system (e.g. SSH). 3. Create the bundle directory for the project. @@ -135,34 +194,26 @@ CEDA INSTALL DB2CONN(CDEVJODB) GROUP(CDEVJODB) jar xf file.zip ``` -### Deploying using CICS Explorer -1. Copy and paste the built JAR from your *projects/cics-java-osgi-jdbc-app/target* or *projects/cics-java-osgi-jdbc-app/build/libs* directory into a Eclipse CICS bundle project. -2. Create a new OSGi bundlepart that references the JAR file. -3. Deploy the CICS bundle project from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. - -### Deploying using CICS Explorer and CICS Bundle ZIP -1. Connect to USS on the host system (e.g. SSH). -2. Create the bundle directory for the project. -3. Copy & paste the built CICS bundle ZIP file from your *projects/cics-java-osgi-jdbc-bundle/target* or *projects/cics-java-osgi-jdbc-bundle/build/distributions* directory to z/FS on the host system into the bundle directory. -4. Extract ther ZIP by right-clicking on the ZIP file > User Action > unjar... -5. Refresh the bundle directory - --- -### Installing the bundle +## Installing the CICS bundle +### Installing the CICS bundle from a CICS terminal 1. Create a new bundle definition, setting the bundle directory to the deployed bundle directory: ``` BUNDLE(CDEVJODB) GROUP(CDEVJODB) BUNDLEDIR(/path/to/bundle/directory) ``` 2. Install the bundle -### Installing the bundle with CICS Explorer + +### Installing the CICS bundle with CICS Explorer 1. Definitions > Bundle Definitions 2. Right-click > New... 3. Fill in the Bundle and Group names as `CDEVJODB` 4. Fill in the Bundle Directory to point to the directory you expanded the ZIP 5. Install the bundle +--- + ## Running To run the sample, run the transaction `JODB`. From 16cda2b3e50922e0a3543623a133f60a9bb6248c Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Fri, 9 May 2025 10:32:34 +0100 Subject: [PATCH 8/8] change to db13 --- README.md | 6 +++--- etc/jvmprofiles/DFHOSGI.jvmprofile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 92ed83e..5abba8b 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ A JAR file is created inside the `cics-java-osgi-jdbc-app/target` directory and To allow your CICS region to connect to DB2, we need to add some configuration to the JCL. ``` -// SET DB2=V12 - DB2 Version +// SET DB2=V13 - DB2 Version ... ... @@ -133,12 +133,12 @@ Configure the JVM profile of the OSGi JVM server to include the Db2 driver JARs > Note: The name of your JVM profile is assumed to be 'DFHOSGI' but can be changed in your Maven/Gradle build files ``` -DB2_PATH=/usr/lpp/db2v12 +DB2_PATH=/usr/lpp/db2v13 OSGI_BUNDLES=&DB2_PATH;/jdbc/classes/db2jcc4.jar,\ &DB2_PATH;/jdbc/classes/db2jcc_license_cisuz.jar LIBPATH_SUFFIX=&DB2_PATH;/jdbc/lib ``` ->Note: This example is using db2v12, this version must be consistent to the version set in your JCL. +>Note: This example is using db2v13, this version must be consistent to the version set in your JCL. As an example, see the provided [JVM profile template](etc/jvmprofiles/DFHOSGI.jvmprofile). If necessary, restart the JVM server. ### Option 1 - Configure the DB2CONN with CEDA at a terminal diff --git a/etc/jvmprofiles/DFHOSGI.jvmprofile b/etc/jvmprofiles/DFHOSGI.jvmprofile index e598b87..2a5b0ca 100644 --- a/etc/jvmprofiles/DFHOSGI.jvmprofile +++ b/etc/jvmprofiles/DFHOSGI.jvmprofile @@ -28,7 +28,7 @@ WORK_DIR=. _BPXK_DISABLE_SHLIB=YES # Db2 paths -DB2_PATH=/usr/lpp/db2v12 +DB2_PATH=/usr/lpp/db2v13 OSGI_BUNDLES=&DB2_PATH;/jdbc/classes/db2jcc4.jar,\ &DB2_PATH;/jdbc/classes/db2jcc_license_cisuz.jar LIBPATH_SUFFIX=&DB2_PATH;/jdbc/lib