From aca1d7660b709821c7d167a7765cbb60ac95b5b6 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Wed, 28 May 2025 16:28:10 +0100 Subject: [PATCH 1/8] start of fixes --- .settings/org.eclipse.buildship.core.prefs | 13 +++++++++++++ .settings/org.eclipse.core.resources.prefs | 2 ++ .settings/org.eclipse.jdt.core.prefs | 15 +++++++++++++++ .../.settings/org.eclipse.buildship.core.prefs | 13 +++++++++++++ .../.settings/org.eclipse.core.resources.prefs | 2 ++ .../org.eclipse.ltk.core.refactoring.prefs | 2 ++ .../.settings/org.eclipse.buildship.core.prefs | 13 +++++++++++++ .../.settings/org.eclipse.jdt.apt.core.prefs | 4 +++- .../.settings/org.eclipse.jdt.core.prefs | 6 ++---- .../.settings/org.eclipse.wst.common.component | 13 ++++++++++--- .../org.eclipse.wst.common.project.facet.core.xml | 2 +- .../.settings/org.eclipse.core.resources.prefs | 3 ++- .../META-INF/cics.xml | 6 +++--- .../cics-java-liberty-jdbc-web.warbundle | 2 ++ .../com.ibm.cicsdev.jdbc.web.warbundle | 2 -- 15 files changed, 83 insertions(+), 15 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-liberty-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs create mode 100644 cics-java-liberty-jdbc-bundle/.settings/org.eclipse.core.resources.prefs create mode 100644 cics-java-liberty-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 cics-java-liberty-jdbc-web/.settings/org.eclipse.buildship.core.prefs create mode 100644 etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/cics-java-liberty-jdbc-web.warbundle delete mode 100644 etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/com.ibm.cicsdev.jdbc.web.warbundle diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..b8c0199 --- /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-liberty-jdbc-web +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-liberty-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs b/cics-java-liberty-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..9d10e56 --- /dev/null +++ b/cics-java-liberty-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-liberty-jdbc-web +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-liberty-jdbc-bundle/.settings/org.eclipse.core.resources.prefs b/cics-java-liberty-jdbc-bundle/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..896a9a5 --- /dev/null +++ b/cics-java-liberty-jdbc-bundle/.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/cics-java-liberty-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs b/cics-java-liberty-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 0000000..243b3fd --- /dev/null +++ b/cics-java-liberty-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/cics-java-liberty-jdbc-web/.settings/org.eclipse.buildship.core.prefs b/cics-java-liberty-jdbc-web/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..60b1463 --- /dev/null +++ b/cics-java-liberty-jdbc-web/.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-liberty-jdbc-web/.settings/org.eclipse.jdt.apt.core.prefs b/cics-java-liberty-jdbc-web/.settings/org.eclipse.jdt.apt.core.prefs index 5ab282b..27769d2 100644 --- a/cics-java-liberty-jdbc-web/.settings/org.eclipse.jdt.apt.core.prefs +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.jdt.apt.core.prefs @@ -1,3 +1,5 @@ eclipse.preferences.version=1 org.eclipse.jdt.apt.aptEnabled=false -org.eclipse.jdt.apt.reconcileEnabled=true +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-liberty-jdbc-web/.settings/org.eclipse.jdt.core.prefs b/cics-java-liberty-jdbc-web/.settings/org.eclipse.jdt.core.prefs index c3e0df7..a361f77 100644 --- a/cics-java-liberty-jdbc-web/.settings/org.eclipse.jdt.core.prefs +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.jdt.core.prefs @@ -10,8 +10,6 @@ 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.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.processAnnotations=disabled +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-liberty-jdbc-web/.settings/org.eclipse.wst.common.component b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.component index 3bb6709..61e39af 100644 --- a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.component +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.component @@ -1,9 +1,16 @@ + - + - + + + + + + - \ No newline at end of file + + diff --git a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml index 7fdd159..af4d320 100644 --- a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -5,5 +5,5 @@ - + diff --git a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.settings/org.eclipse.core.resources.prefs b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.settings/org.eclipse.core.resources.prefs index a3968f9..9c72a69 100644 --- a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.settings/org.eclipse.core.resources.prefs +++ b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding//META-INF/cics.xml=UTF-8 -encoding/com.ibm.cicsdev.jdbc.web.warbundle=UTF-8 +encoding/=UTF-8 +encoding/cics-java-liberty-jdbc-web.warbundle=UTF-8 \ No newline at end of file diff --git a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml index 17a465e..4b33c87 100644 --- a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml +++ b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml @@ -1,7 +1,7 @@ - + 2017-08-01T09:50:06.715+01:00 - - + + \ No newline at end of file diff --git a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/cics-java-liberty-jdbc-web.warbundle b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/cics-java-liberty-jdbc-web.warbundle new file mode 100644 index 0000000..72f3b77 --- /dev/null +++ b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/cics-java-liberty-jdbc-web.warbundle @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/com.ibm.cicsdev.jdbc.web.warbundle b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/com.ibm.cicsdev.jdbc.web.warbundle deleted file mode 100644 index 6e89cb9..0000000 --- a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/com.ibm.cicsdev.jdbc.web.warbundle +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file From 28ed2d91714eb42254d8b721c982446c63330cc6 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Wed, 28 May 2025 17:37:43 +0100 Subject: [PATCH 2/8] more changes --- .project | 2 +- cics-java-liberty-jdbc-web/.project | 12 ++++++++++++ cics-java-liberty-jdbc-web/build.properties | 7 +++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 cics-java-liberty-jdbc-web/build.properties diff --git a/.project b/.project index e8eccf8..3d318b9 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - com.ibm.cicsdev.springboot.jdbc + cics-java-liberty-jdbc diff --git a/cics-java-liberty-jdbc-web/.project b/cics-java-liberty-jdbc-web/.project index 1684f42..5e5286c 100644 --- a/cics-java-liberty-jdbc-web/.project +++ b/cics-java-liberty-jdbc-web/.project @@ -1,6 +1,7 @@ cics-java-liberty-jdbc-web + @@ -29,6 +30,16 @@ + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + org.eclipse.jdt.core.javanature @@ -37,5 +48,6 @@ org.eclipse.jem.workbench.JavaEMFNature org.eclipse.m2e.core.maven2Nature org.eclipse.buildship.core.gradleprojectnature + org.eclipse.pde.PluginNature diff --git a/cics-java-liberty-jdbc-web/build.properties b/cics-java-liberty-jdbc-web/build.properties new file mode 100644 index 0000000..b9feb72 --- /dev/null +++ b/cics-java-liberty-jdbc-web/build.properties @@ -0,0 +1,7 @@ +source.. = src/main/java + +web.content.dir = src/main/webapp + +jre.compilation.profile = JavaSE-1.8 + +war.name = cics-java-liberty-jdbc-web.war \ No newline at end of file From 57ec646fecf25a790d01ef0daaf7f7d566604da7 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 29 May 2025 11:43:41 +0100 Subject: [PATCH 3/8] fixes --- .../org.eclipse.core.resources.prefs | 1 - .../org.eclipse.wst.common.component | 25 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/cics-java-liberty-jdbc-web/.settings/org.eclipse.core.resources.prefs b/cics-java-liberty-jdbc-web/.settings/org.eclipse.core.resources.prefs index e9441bb..99f26c0 100644 --- a/cics-java-liberty-jdbc-web/.settings/org.eclipse.core.resources.prefs +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,2 @@ eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 encoding/=UTF-8 diff --git a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.component b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.component index 61e39af..0d23bd7 100644 --- a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.component +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.component @@ -1,16 +1,27 @@ - + + + - + - - + + + + + - + + + - - + + + + + + From 9e9f51006f2ab3e8880109fbf45645288234914c Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 29 May 2025 12:07:21 +0100 Subject: [PATCH 4/8] fixes --- .project | 1 + cics-java-liberty-jdbc-bundle/.project | 1 + 2 files changed, 2 insertions(+) diff --git a/.project b/.project index 3d318b9..4b9c5c5 100644 --- a/.project +++ b/.project @@ -1,6 +1,7 @@ cics-java-liberty-jdbc + diff --git a/cics-java-liberty-jdbc-bundle/.project b/cics-java-liberty-jdbc-bundle/.project index b753789..fe73fe3 100644 --- a/cics-java-liberty-jdbc-bundle/.project +++ b/cics-java-liberty-jdbc-bundle/.project @@ -1,6 +1,7 @@ cics-java-liberty-jdbc-bundle + From e110b41c51e9c3424a215d3f5f29289c406aa1dd Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 29 May 2025 12:09:26 +0100 Subject: [PATCH 5/8] gitignored files --- .gitignore | 8 ++--- cics-java-liberty-jdbc-web/.classpath | 16 +++++++++ .../.project | 33 +++++++++++++++++++ 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 cics-java-liberty-jdbc-web/.classpath create mode 100644 etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.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-liberty-jdbc-web/.classpath b/cics-java-liberty-jdbc-web/.classpath new file mode 100644 index 0000000..88cfc03 --- /dev/null +++ b/cics-java-liberty-jdbc-web/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.project b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.project new file mode 100644 index 0000000..913ed1e --- /dev/null +++ b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/.project @@ -0,0 +1,33 @@ + + + com.ibm.cics.server.examples.wlp.jdbc.bundle + + + + + + com.ibm.cics.bundle.ui.bundlebuilder + + + bundleID + com.ibm.cics.server.examples.wlp.jdbc.bundle + + + majorVersion + + + + microVersion + + + + minorVersion + + + + + + + com.ibm.cics.bundle.ui.bundlenature + + \ No newline at end of file From 097751073839dee92abb1a0fbbfef9a0ea3d4646 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 29 May 2025 12:10:09 +0100 Subject: [PATCH 6/8] fix java version --- cics-java-liberty-jdbc-web/.classpath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cics-java-liberty-jdbc-web/.classpath b/cics-java-liberty-jdbc-web/.classpath index 88cfc03..3497b68 100644 --- a/cics-java-liberty-jdbc-web/.classpath +++ b/cics-java-liberty-jdbc-web/.classpath @@ -6,7 +6,7 @@ - + From 06db67071dec1c5cf6707f5090fa79de72c1dd9e Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 29 May 2025 12:21:37 +0100 Subject: [PATCH 7/8] readme & changes --- README.md | 213 +++++++++++------- ...se.wst.common.project.facet.core.prefs.xml | 7 + ....eclipse.wst.common.project.facet.core.xml | 1 + .../META-INF/cics.xml | 2 +- 4 files changed, 136 insertions(+), 87 deletions(-) create mode 100644 cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml diff --git a/README.md b/README.md index b1a63c4..25057a1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # cics-java-liberty-jdbc -[![Build](https://github.com/SoftlySplinter/cics-java-liberty-jdbc/actions/workflows/java.yaml/badge.svg?branch=cicsts%2Fv5.5)](https://github.com/SoftlySplinter/cics-java-liberty-jdbc/actions/workflows/java.yaml) - -Sample JDBC Java EE web application demonstrating how to access a Db2 database from a web servlet in CICS Liberty. +This sample demonstrates how to code, build, and deploy a CICS Java application that makes JDBC calls to Db2 from a web servlet in CICS Liberty. 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. ## Contents This is a set of sample Java projects for database interaction in CICS Java, demonstrating how you can use JDBC in a WAR in a Liberty JVM server, to allow it query items in Db2. @@ -9,71 +7,56 @@ This is a set of sample Java projects for database interaction in CICS Java, dem This sample can use either Db2 type 2 or type 4 connectivity. * [`cics-java-liberty-jdbc-web`](cics-java-liberty-jdbc-web) - Dynamic web project containing the Java source. -* [`java-java-liberty-jdbc-bundle`](cics-java-liberty-jdbc-bundle) - CICS bundle project (Gradle/Maven) +* [`java-java-liberty-jdbc-bundle`](cics-java-liberty-jdbc-bundle) - CICS bundle plug-in based project, contains Web application bundle-parts. Use with Gradle and Maven builds. * [`etc/config/liberty`](etc/config/liberty) - Liberty server configuration files -* [`etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle`](etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle) - CICS bundle project (CICS Exp +* [`etc/eclipse_projects/com.ibm.cics.server.examples.wlp.jdbc.bundle`](etc/eclipse_projects/com.ibm.cics.server.examples.wlp.jdbc.bundle) - CICS bundle project (CICS Explorer based CICS bundle project, contains Web application bundle-parts. Use with CICS Explorer 'Export to zFS' deployment capability.) -## Prerequisites -* CICS TSf for z/OS V5.5 -* Java SE 8 or later on the z/OS system -* CICS Explorer with the IBM CICS SDK for Java EE and Liberty feature installed [available here](https://developer.ibm.com/mainframe/products/downloads), Gradle, or Apache Maven. -* IBM Db2 for z/OS +## Requirements +* CICS TS V5.5 or later +* A connected CICS DB2CONN resource. For more information, see [CONFIGURING](#configuring) +* A Liberty JVM server +* Java SE 1.8 or later on the workstation +* IBM Db2 V13 or later on z/OS ## Downloading -* Clone the repository using your IDEs support, such as the Eclipse Git plugin -* or, download the sample as a ZIP and unzip onto the workstation -> [!Tip] -> Eclipse Git provides an 'Import existing Projects' check-box when cloning a repository. +- 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-liberty-jdbc/archive/cicsts/v5.5.zip) and unzip onto the workstation -### Check dependencies -Before building this sample, you should verify that the correct CICS TS bill of materials (BOM) is specified for your target release of CICS. The BOM specifies a consistent set of artifacts, and adds information about their scope. In the example below the version specified is compatible with CICS TS V5.5 with JCICS APAR PH25409, or newer. That is, the Java byte codes built by compiling against this version of JCICS will be compatible with later CICS TS versions and subsequent JCICS APARs. -You can browse the published versions of the CICS BOM at [Maven Central.](https://mvnrepository.com/artifact/com.ibm.cics/com.ibm.cics.ts.bom) - -Gradle (build.gradle): - -`compileOnly enforcedPlatform("com.ibm.cics:com.ibm.cics.ts.bom:5.5-20200519131930-PH25409")` - -Maven (POM.xml): - -``` xml - - - - com.ibm.cics - com.ibm.cics.ts.bom - 5.5-20200519131930-PH25409 - pom - import - - - - ``` +> [!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 Gradle or Maven wrappers will give a consistent version of build tooling. +You can build the sample in a variety of ways: +- Using the implicit compile/build of the Eclipse based CICS Explorer SDK +- Using the built-in Gradle or Maven support of your IDE (For example: *buildship* or *m2e* in Eclipse which integrate with the "Run As..." menu.) +- Using the supplied Gradle or Maven Wrapper scripts (no requirement for an IDE or Gradle/Maven install) +- or you can build it from the command line if you have Gradle or Maven installed on your workstation -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 a specific version of your chosen build tool. -> [!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: right-click on "Project", select "Gradle -> Refresh Gradle Project", **or** right-click on "Project", select "Maven -> Update Project...". +> [!IMPORTANT] +> The sample comes pre-configured for use with a JDK 8 and CICS TS V5.5 Libraries for Java EE 8. When you initially import the project to your IDE, if your IDE is not configured for a JDK 8, or does not have CICS Explorer SDK installed, you might experience local project compile errors. To resolve issues you should configure the Project's build-path to add/remove your preferred combination of CICS TS, JDK, and Liberty's Enterprise Java libraries (Java EE or Jakarta EE). Resolving errors might also depend on how you wish to build and deploy the sample. If you are building and deploying through CICS Explorer SDK and 'Export to zFS' you should edit the link-app's Project properties. Select 'Java Build Path', on the Libraries tab select 'Classpath', click 'Add Library', select 'CICS with Enterprise Java and Liberty' Library, and choose the appropriate CICS and Enterprise Java versions. +If you are building and deploying with Gradle or Maven then you don't necessarily need to fix the local errors, but to do so, you can do as above, or you can run a tooling refresh on the link-app project. For example, in Eclipse: right-click on "Project", select "Gradle -> Refresh Gradle Project", **or** 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. -### Eclipse +### Option 1: Building with Eclipse + +If you are using the Egit client to clone the repo, remember to tick the button to import all projects. Otherwise, you should manually Import the projects into CICS Explorer using File → Import → General → Existing projects into workspace, then follow the error resolution advice above. -Import the projects into CICS Explorer using File → Import → General → Existing projects into workspace. -> [!NOTE] -> If using the egit client, you can just clone the repo and tick the button to import all projects. +### Option 2: Building with Gradle -### Building with Gradle +For a complete build you should run the settings.gradle file in the top-level 'cics-java-liberty-jdbc' directory which is designed to invoke the individual build.gradle files for each project. -A WAR file is created inside the `cics-java-liberty-jdbc-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-liberty-jdbc-bundle/build/distribution` directory. +If successful, a WAR file is created inside the `cics-java-liberty-jdbc-web/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-liberty-jdbc-bundle/build/distribution` directory. -The JVM server the CICS bundle is targeted at is controlled through the `cics.jvmserver` property, or in the command line. +[!NOTE] +In Eclipse, the output 'build' directory is often hidden by default. From the Package Explorer pane, select the three dot menu, choose filters and un-check the Gradle build folder to view its contents. + +The JVM server the CICS bundle is targeted at is controlled through the `cics.jvmserver` property, defined in the [`cics-java-liberty-jdbc-bundle/build.gradle`](cics-java-liberty-jdbc-bundle/build.gradle) file, or alternatively can be set on the command line: **Gradle Wrapper (Linux/Mac):** ```shell @@ -92,11 +75,12 @@ gradle clean build gradle clean build -Pcics.jvmserver=MYJVM ``` -### Building with Maven +### Option 3: Building with Apache Maven -A WAR file is created inside the `cics-java-liberty-jdbc-app/target` directory and a CICS bundle ZIP file inside the `cics-java-liberty-jdbc-bundle/target` directory. +For a complete build you should run the pom.xml file in the top-level 'cics-java-liberty-jdbc' directory. A WAR file is created inside the `cics-java-liberty-jdbc-web/target` directory and a CICS bundle ZIP file inside the `cics-java-liberty-jdbc-bundle/target` directory. -The JVM server the CICS bundle is targeted at is controlled throught the `cics.jvmserver` property, defined in [`cics-java-liberty-jdbc-bundle/pom.xml`](cics-java-liberty-jdbc-bundle/pom.xm) file under the `defaultjvmserver` configuration property, or in the command line. +If building a CICS bundle ZIP the CICS JVM server name for the WAR bundle part should be modified in the + `cics.jvmserver` property, defined in [`cics-java-liberty-jdbc-bundle/pom.xml`](cics-java-liberty-jdbc-bundle/pom.xml) file under the `defaultjvmserver` configuration property, or alternatively can be set on the command line. **Maven Wrapper (Linux/Mac):** ```shell @@ -117,52 +101,109 @@ mvn clean verify -Dcics.jvmserver=MYJVM ## Configuring -### Configure Db2 -THis sample uses the [EMP table](https://www.ibm.com/docs/en/db2-for-zos/latest?topic=tables-employee-table-dsn8d10emp) provided with the [Db2 sample tables](https://www.ibm.com/docs/en/db2-for-zos/latest?topic=zos-db2-sample-tables). +### Configure CICS for Db2 +To allow your CICS region to connect to DB2, we need to add some configuration to the JCL. + +``` +// SET DB2=V13 - DB2 Version +... + +... +DB2CONN=YES + +//STEPLIB +... +// DD DISP=SHR,DSN=SYS2.DB2.&DB2..SDSNLOAD +// DD DISP=SHR,DSN=SYS2.DB2.&DB2..SDSNLOD2 +``` + +### Configure the Liberty with DB2 +This sample uses the [EMP table](https://www.ibm.com/docs/en/db2-for-zos/latest?topic=tables-employee-table-dsn8d10emp) provided with the [Db2 sample tables](https://www.ibm.com/docs/en/db2-for-zos/latest?topic=zos-db2-sample-tables). +Configure the JVM profile of the Liberty JVM server to include the Db2 driver location. +> [!TIP] +> There are several options to configuring the database schema. The following config defines the schema in the JVM profile, however, the schema can be defined directly in the datasource in the server.xml in the datasource properties element. Or it can be defined in the application code itself once setting a connection. -### Configure CICS for JDBC type 2 connectivity to Db2 -_If using Db2 type 2 connectivity to Db2_ +> Note: The name of your JVM profile is assumed to be 'DFHWLP' -1. Update the CICS STEPLIB with the Db2 SDSNLOAD and SDSNLOD2 libraries -2. Configure CICS DB2CONN, Db2TRAN and Db2ENTRY resource definitions as described in [How you can define the CICS Db2 connection](https://www.ibm.com/docs/en/cics-ts/latest?topic=sources-defining-cics-db2-connection). -3. Bind the Db2 plan that is specified in the CICS DB2CONN or DB2ENTRY definition with a PKLIST of NULLID.* +``` +-Dcom.ibm.cics.jvmserver.wlp.jdbc.driver.location=/usr/lpp/db2v13/jdbc +-Ddb2.jcc.override.currentSchema=DBADMIN +``` +> Note: This example is using db2v13, this version must be consistent to the version set in your JCL. -## Deploying to a Liberty JVM server +As an example, see the provided [JVM profile template](etc/config/jvmprofile/DFHWLP.jvmprofile). If necessary, restart the JVM server. -Ensure you have the following features defined in your Liberty server.xml: -* `jdbc-4.0` (or above) -* If using Db2 type 2, add the following property to the JVM profile: - - ``` - -Dcom.ibm.cics.jvmserver.wlp.jdbc.driver.location=/usr/lpp/db2v13/jdbc - ``` -A template server.xml is provided [here](etc/config/liberty/server.xml). - -### Deploying CICS Bundles with CICS Explorer -1. Change the name of the JVMSERVER in the .warbundle file of the CICS bundle project from DFHWLP to the name of the JVMSERVER resource defined in CICS. -2. Export the bundle project to zFS by selecting 'Export Bundle project to z/OS Unix File System' from the context menu. -3. Create a bundle definition, setting the bundle directory attribute to the zFS location you just exported to, and install it. -4. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command. - -### Deploying CICS Bundles from Gradle or Maven -1. Manually upload the ZIP file from the _cics-java-liberty-jdbc-bundle/target_ or _cics-java-liberty-jdbc-bundle/build/distributions_ directory to zFS. -2. Unzip this ZIP file on zFS (e.g. `${JAVA_HOME}/bin/jar xf /path/to/bundle.zip`). -3. Create a CICS BUNDLE resource definition, setting the bundle directory attribute to the zFS location you just extracted to, and install it into the CICS region. -4. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command. - -### Deploying with Liberty configuration -1. Manually upload the WAR file from the _cics-java-liberty-jdbc-app/target_ or _cics-java-liberty-jdbc-app/build/libs_ directory to zFS. -2. Add an `` element to the Liberty server.xml to define the web application. -3. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command. +Ensure you have the following feature defined in your Liberty server.xml: +* `jdbc-4.0` + +A template server.xml is provided [here](./etc/config/liberty/server.xml). + +### Option 1 - Configure the DB2CONN with CEDA at a terminal + +Ensure a CICS DB2CONN is installed and connected. + +``` +CEDA DEFINE DB2CONN(JODBCONN) GROUP(CDEVJLDB) +``` +``` +CEDA INSTALL DB2CONN(JODBCONN) GROUP(CDEVJLDB) +``` + +### 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 `CDEVJLDB` +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. Consult your CICS system programmer if you are unsure. + + +--- + +## 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.wlp.jdbc.bundle' from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. This CICS bundle includes the WAR bundlepart to run the sample. + + +### Option 2 - Deploying using CICS Explorer SDK with own CICS bundle project +1. Copy and paste the built WAR from your *projects/cics-java-liberty-jdbc-web/target* or *projects/cics-java-liberty-jdbc-web/build/libs* directory into a new Eclipse CICS bundle project. +2. Create a new bundlepart that references the WAR 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-liberty-jdbc-bundle/target* or *projects/cics-java-liberty-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-liberty-jdbc-bundle/target* or *projects/cics-java-liberty-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. +4. Move the CICS bundle ZIP file into the bundle directory. +5. Change directory into the bundle directoy. +6. Extract the CICS bundle ZIP file. This can be done using the `jar` command. For example: + ```shell + jar xf file.zip + ``` + +--- ## Running the sample -The servlet is accessed with the following URL: [http://zos.example.com:9080/com.ibm.cicsdev.jdbc.web/database](http://zos.example.com:9080/com.ibm.cicsdev.jdbc.web/database). +The servlet is accessed with the following URL: [http://zos.example.com:9080/cics-java-liberty-jdbc-web/database](http://zos.example.com:9080/cics-java-liberty-jdbc-web/database). If the test is successful, you will see a response similar to the following written to the browser: `Db2 current timestamp: 2024-01-01 09:30:00.000000.` -If the EMP table is available, the full sample can be accessed with the following URL: [http://zos.example.com:9080/com.ibm.cicsdev.jdbc.web/](http://zos.example.com:9080/com.ibm.cicsdev.jdbc.web/). This is a HTML page that communicates with a servlet backend to display the employees in the EMP table. +If the EMP table is available, the full sample can be accessed with the following URL: [http://zos.example.com:9080/cics-java-liberty-jdbc-web/](http://zos.example.com:9080/cics-java-liberty-jdbc-web/). This is a HTML page that communicates with a servlet backend to display the employees in the EMP table. + ## Reference diff --git a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..cc81385 --- /dev/null +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml index af4d320..5c70e35 100644 --- a/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/cics-java-liberty-jdbc-web/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -6,4 +6,5 @@ + diff --git a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml index 4b33c87..65e9b08 100644 --- a/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml +++ b/etc/eclipse_projects/com.ibm.cicsdev.jdbc.web.cicsbundle/META-INF/cics.xml @@ -4,4 +4,4 @@ 2017-08-01T09:50:06.715+01:00 - \ No newline at end of file + From 3c1d76ce2e8afa036423531860b3c8309c3a3073 Mon Sep 17 00:00:00 2001 From: Aaron Jhaj Date: Thu, 29 May 2025 12:22:29 +0100 Subject: [PATCH 8/8] minor changes --- README.md | 2 +- etc/config/jvmprofile/DFHWLP.jvmprofile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25057a1..914bb8d 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Configure the JVM profile of the Liberty JVM server to include the Db2 driver lo As an example, see the provided [JVM profile template](etc/config/jvmprofile/DFHWLP.jvmprofile). If necessary, restart the JVM server. Ensure you have the following feature defined in your Liberty server.xml: -* `jdbc-4.0` +* `jdbc-4.1` A template server.xml is provided [here](./etc/config/liberty/server.xml). diff --git a/etc/config/jvmprofile/DFHWLP.jvmprofile b/etc/config/jvmprofile/DFHWLP.jvmprofile index c23b99b..4871abd 100644 --- a/etc/config/jvmprofile/DFHWLP.jvmprofile +++ b/etc/config/jvmprofile/DFHWLP.jvmprofile @@ -32,4 +32,5 @@ WLP_INSTALL_DIR=&USSHOME;/wlp _BPXK_DISABLE_SHLIB=YES # Define the Db2 type 2 driver (if using Db2 type 2) --Dcom.ibm.cics.jvmserver.wlp.jdbc.driver.location=/usr/lpp/db2v13/jdbc \ No newline at end of file +-Dcom.ibm.cics.jvmserver.wlp.jdbc.driver.location=/usr/lpp/db2v13/jdbc +-Ddb2.jcc.override.currentSchema=DBADMIN \ No newline at end of file