在用SpringBatch 跑job的时候出现这个错误, 由于取数据的DB 是netezza, 框架可能支持的不是很全面,当然也可能是其他原因。
<bean id="reader_rdc" class="org.springframework.batch.item.database.JdbcCursorItemReader" scope="step"> <property name="dataSource" ref="rdc-datasource" /> <property name="sql"> <value> <![CDATA[ SELECT DISTINCT C.SAP_CUSTOMER_NO, case WHEN C.SAP_CUSTOMER_NO > 1 THEN C.SAP_CUSTOMER_NO + 10000000000 END AS SAP_CUSTOMER_NO_11_POS, G.IOT_NAME, --G.IMT_NAME, CASE WHEN G.ISO_COUNTRY_NAME = 'United States' THEN 'United States' ELSE G.IMT_NAME END AS IMT_NAME, G.ISO_COUNTRY_NAME, C.ISSUING_COUNTRY_NO, C.SAP_DIM_ISO_COUNTRY_CODE, C.MANDT, C.CUST_NAME, C.STREET_ADDRESS, C.CUST_CITY, C.CUST_STATE_PROV, C.CUST_NO, LENGTH(C.CUST_NO) AS CUST_NUM_LENGTH, C.CUST_COUNTY_CODE, H.DUNS_NO, C.ENTERPRISE_NO, C.MKT_AFFILIATE_NO, C.DOM_CLIENT_ID, SUBSTRING(C.GBL_BUY_GRP_ID,1,2) AS GBG_Mnemonic, '1' AS RECORD_COUNT, F.LEGAL_DOM_CLIENT_NAME, -- FROM SAPR3.LEGAL_DOM_CLIENT C.GBL_CLIENT_ID, C.GBL_ULT_CLIENT_ID, C.DOM_BUY_GRP_ID, C.GBL_BUY_GRP_ID, C.SAP_DIM_BASE_TYPE, C.SAP_DIM_BASE_COVID, B.COV_CLIENT_TYPE, D.COV_CLIENT_TYPE_DESC, J.CAP_IND, K.AUFSD AS ORDER_NO, S.INDUSTRY_CODE, S.INDUSTRY_NAME FROM CUST.SAP_COVERAGE_CUSTOMER C LEFT OUTER JOIN CUST.SAP_DIM_COVERAGE A ON C.SAP_DIM_BASE_COVID = A.COV_ID AND C.SAP_DIM_BASE_TYPE = A.COV_TYPE LEFT OUTER JOIN SAPR3.V_COVERAGE_ID_CLIENT_TYPE B ON A.COV_TYPE = B.COVTYPE AND A.COV_ID = B.COVID AND C.MANDT = B.MANDT LEFT OUTER JOIN NZCCMS.CUST_SAP_DIM_ISO_COUNTRY G ON C.SAP_DIM_ISO_COUNTRY_CODE = G.ISO_COUNTRY_CODE LEFT OUTER JOIN SAPR3.COVERAGE_CLIENT_TYPE D ON B.COV_CLIENT_TYPE = D.COV_CLIENT_TYPE AND C.MANDT = D.MANDT LEFT OUTER JOIN SAPR3.KDUNS H ON C.MANDT = H.MANDT AND C.SAP_CUSTOMER_NO = H.KUNNR LEFT OUTER JOIN SAPR3.LEGAL_DOM_CLIENT F ON C.DOM_CLIENT_ID = F.DOM_CLIENT_ID AND C.MANDT = F.MANDT LEFT OUTER JOIN SAPR3.KUNNR_EXT J ON C.MANDT = J.MANDT AND C.SAP_CUSTOMER_NO = J.KUNNR LEFT OUTER JOIN SAPR3.KNA1 K ON C.MANDT = K.MANDT AND C.SAP_CUSTOMER_NO = K.KUNNR LEFT OUTER JOIN NZCCMS.CUST_SAP_DIM_SIC_CODE S ON C.SAP_DIM_UNSIC_CODE = S.UNSIC_CODE WHERE J.CAP_IND= 'Y' AND C.MANDT = '100' AND K.AUFSD NOT IN('75','90','93') AND B.COV_CLIENT_TYPE IN ('R','C','E','D') ]]> </value> </property> <property name="rowMapper"> <bean class="flow.RdcMapper" /> </property> <property name="verifyCursorPosition"> <value>false</value> </property> </bean>
将 verifyCursorPosition 属性设成 false 即可。