From fcf6e942483db550d7d5c94d1c9c977da9afe9b5 Mon Sep 17 00:00:00 2001 From: Coby Pritchard Date: Fri, 26 Feb 2016 22:23:32 -0600 Subject: [PATCH] Handle DB2 on the AS/400 (iSeries) and DB2 Server for VM and VSE DB2 connections to the AS/400 report incorrectly back as DB2 z/OS. The current AS/400 reports Database Product Name as "DB2 UDB for AS/400". Database Product Version has three possible return values based on product used: JTOpen reports "07.01.0000 V7R1m0". Native Driver reports "V7R1M0". PRDID reports "QSQ07010" http://www-01.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/com.ibm.db2z10.doc.java/src/tpc/imjcc_c0053013.dita Also added code to handle DB2 Server for VM and VSE. This code should handle the different DB2 Versions. Spring Community Contributor --- .../SqlPagingQueryProviderFactoryBean.java | 4 +++ .../batch/support/DatabaseType.java | 13 +++++++-- .../batch/support/DatabaseTypeTests.java | 29 +++++++++++++++++-- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryProviderFactoryBean.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryProviderFactoryBean.java index 32c66a656..3f6f020e9 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryProviderFactoryBean.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryProviderFactoryBean.java @@ -16,7 +16,9 @@ package org.springframework.batch.item.database.support; import static org.springframework.batch.support.DatabaseType.DB2; +import static org.springframework.batch.support.DatabaseType.DB2VSE; import static org.springframework.batch.support.DatabaseType.DB2ZOS; +import static org.springframework.batch.support.DatabaseType.DB2AS400; import static org.springframework.batch.support.DatabaseType.DERBY; import static org.springframework.batch.support.DatabaseType.H2; import static org.springframework.batch.support.DatabaseType.HSQL; @@ -70,7 +72,9 @@ public class SqlPagingQueryProviderFactoryBean implements FactoryBean