/*******************************************************************************
*	 All Rights reserved,Copyright (c) K-Opticom 
********************************************************************************
*＜プログラム内容＞
*	システム名		：eo顧客基幹システム
*	モジュール名	：JSYejbKK0791KRCK
*	ソースファイル名：JSYejbKK0791KRCK.java
*	作成者			：EK916889
*	日付			：2015年05月18日
*＜機能概要＞
*	関連チェック部品です。
*＜修正履歴＞
*	バージョン	修正日		修正者		修正内容
*	ｖ1.00.00
*
********************************************************************************/

package eo.ejb.cbm.entity;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.text.ParsePosition;
import com.fujitsu.futurity.model.ejb.common.JSYejbLog;
import com.fujitsu.futurity.model.ejb.common.JSYejbConnection;
import com.fujitsu.futurity.model.ejb.common.StatusCodes;
import com.fujitsu.futurity.model.ejb.common.fw.AgentDispatchContext;
import eo.ejb.common.EventIDList;
import com.fujitsu.futurity.model.ejb.common.fw.KanrenCheckHandler;
import eo.ejb.common.JKKModelCommon;

import com.fujitsu.futurity.model.base.CAANConnectionMgr;
import com.fujitsu.futurity.model.base.CAANJDBCUtil;
import com.fujitsu.futurity.model.base.CAANMsg;
import com.fujitsu.futurity.model.base.CAANRuntimeException;

/**
 * 料金コース関連チェッククラスです。
 * ＜メソッド一覧＞
 * invoke
 *	execIKK0081D003_9
 *	execIKK0081D003_13
 *	execIKK0081D005_9
 *	execIKK0081D005_13
 *	execIKK0081D008_9
 *	execIKK0081D008_13
 *	execIKK0081D017_8
 *	execIKK0081D017_9
 *	execIKK0081D018_8
 *	execIKK0081D018_9
 *	execIKK0081D022_8
 *	execIKK0081D022_9
 *	execIKK0081D071_5
 *	execIKK0081D071_6
 *	execIKK0081D080_5
 *	execIKK0081D080_6
 *	execIKK0161D011_5
 *	execIKK0161D011_8
 *	execIKK0161D031_5
 *	execIKK0161D031_6
 *	execIKK0341C004_2
 *	execIKK0341D002_4
 *	execIKK0341D002_14
 *	execIKK0341D015_3
 *	execIKK0341D015_4
 *	execIKK0341D018_7
 *	execIKK0341D018_8
 *	execIKK0351D003_4
 *	execIKK0351D003_8
 *	execIKK0351D003_15
 *	execIKK0351D007_5
 *	execIKK0351D007_11
 *	execIKK0351D008_5
 *	execIKK0351D008_11
 *	execIKK0351D012_4
 *	execIKK0351D012_10
 *	execIKK0351D023_4
 *	execIKK0351D023_8
 *	execIKK0351D023_11
 *	execIKK0351D032_4
 *	execIKK0351D032_10
 *	execIKK0401D002_6
 *	execIKK0401D002_9
 *	execIKK0401D006_6
 *	execIKK0401D006_9
 *	execIKK0401D018_3
 *	execIKK0401D018_6
 *	execIKK0401D019_3
 *	execIKK0401D019_4
 *	execIKK0401D020_5
 *	execIKK0401D020_6
 *	execIKK0441D001_5
 *	execIKK0441D001_11
 *	execIKK0441D018_4
 *	execIKK0441D018_5
 *	execIKK0441D021_5
 *	execIKK0441D021_11
 *	execIKK0451D016_3
 *	execIKK0451D016_4
 *	execIKK0451D022_6
 *	execIKK0451D022_7
 *	execIKK0841C002_5
 *	execIKK0851D001_6
 *	execIKK0851D001_16
 *	execIKK0851D002_6
 *	execIKK0851D002_16
 *	execIKK0931D001_4
 *	execIKK1061D002_5
 *	execIKK1151C001_5
 *	execIKK1151D001_5
 *	execIKK1371D001_6
 *	execIKK1371D002_6
 *	execIKK1931C002_2
 *	execIKK1931D001_3
 *	execIKK2411D001_3
 *	execIKK2811D001_2
 *	execIKK2811D001_3
 *	execIKK2811D019_2
 *	execIKK2811D019_3
 *	execIKK2881C001_5
 *	execIKK2881C001_6
 *	execIKK2881D001_5
 *	execIKK2881D001_6
 *	execIKK2931D001_3
 *
 */

public class JSYejbKK0791KRCK implements KanrenCheckHandler {

	/**
	 * コンストラクタ
	 */

	public JSYejbKK0791KRCK() {
	}

	/**
	 * 料金コース関連チェックを行います。
	 * 
	 * @param inETMsg エンティティ
	 * @param inContext Agentから渡されたAgentDispatchContext
	 */

	public void invoke(CAANMsg inETMsg, AgentDispatchContext inContext) {

		JSYejbLog.println(JSYejbLog.DEBUG, getClass(), "call:JSYejbKK0791KRCK.invoke");

		// inETMsgのチェック
		if(inETMsg == null) {
			throw new CAANRuntimeException("inETMsgがnullです。");
		}

		// 振舞IDの取り出し
		String eventID = inETMsg.getString("eventID");
		if(eventID == null) {
			throw new CAANRuntimeException("振舞IDがnullです。");
		}

		// 処理の振り分け
		// イベントの振り分け
		if(eventID.equals(EventIDList.IKK0081D003)){
			/** サービス契約<eo光TV>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D003_9(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D003_13(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0081D005)){
			/** サービス契約<eo光ネット>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D005_9(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D005_13(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0081D008)){
			/** サービス契約<eo光電話>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D008_9(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D008_13(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0081D017)){
			/** サービス契約<eoADSL>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D017_8(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D017_9(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0081D018)){
			/** サービス契約<ホスティング>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D018_8(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D018_9(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0081D022)){
			/** サービス契約<eoモバイル>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D022_8(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D022_9(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0081D071)){
			/** サービス契約<mineo>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D071_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D071_6(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0081D080)){
			/** サービス契約<eo電気>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0081D080_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0081D080_6(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0161D011)){
			/** サービス契約内訳<eo光TV>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0161D011_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0161D011_8(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0161D031)){
			/** サービス契約内訳<eoモバイル>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0161D031_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0161D031_6(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0341C004)){
			/** 機器提供サービス契約手続中料金コース変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341C004_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0341D002)){
			/** 機器提供サービス契約登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341D002_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0341D002_14(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0341D015)){
			/** 機器提供サービス契約料金コース変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341D015_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0341D015_4(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0341D018)){
			/** 機器提供サービス契約料金プラン変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341D018_7(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0341D018_8(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0351D003)){
			/** オプションサービス契約料金プラン変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0351D003_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D003_8(inETMsg, inContext, "EC");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D003_15(inETMsg, inContext, "EE");
			}

		}else if(eventID.equals(EventIDList.IKK0351D007)){
			/** オプションサービス契約<サポート>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0351D007_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D007_11(inETMsg, inContext, "EC");
			}

		}else if(eventID.equals(EventIDList.IKK0351D008)){
			/** オプションサービス契約<TV>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0351D008_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D008_11(inETMsg, inContext, "EC");
			}

		}else if(eventID.equals(EventIDList.IKK0351D012)){
			/** オプションサービス契約<ISP>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0351D012_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D012_10(inETMsg, inContext, "EC");
			}

		}else if(eventID.equals(EventIDList.IKK0351D023)){
			/** オプションサービス契約手続中料金プラン変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0351D023_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D023_8(inETMsg, inContext, "EC");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D023_11(inETMsg, inContext, "EE");
			}

		}else if(eventID.equals(EventIDList.IKK0351D032)){
			/** オプションサービス契約<電話>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0351D032_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0351D032_10(inETMsg, inContext, "EC");
			}

		}else if(eventID.equals(EventIDList.IKK0401D002)){
			/** サブオプションサービス契約<ISP>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0401D002_6(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0401D002_9(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0401D006)){
			/** サブオプションサービス契約<TV>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0401D006_6(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0401D006_9(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0401D018)){
			/** サブオプションサービス契約手続中料金プラン変更 */
			int Rtn = 0;
			Rtn = execIKK0401D018_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0401D018_6(inETMsg, inContext, "ED");
			}

		}else if(eventID.equals(EventIDList.IKK0401D019)){
			/** サブオプションサービス契約料金プラン変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0401D019_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0401D019_4(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0401D020)){
			/** サブオプションサービス契約<電話>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0401D020_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0401D020_6(inETMsg, inContext, "ED");
			}

		}else if(eventID.equals(EventIDList.IKK0441D001)){
			/** 請求オプションサービス契約登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0441D001_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0441D001_11(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0441D018)){
			/** 請求オプションサービス契約手続中料金プラン振舞概念 */
			int Rtn = 0;
			Rtn = execIKK0441D018_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0441D018_5(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0441D021)){
			/** 請求オプションサービス契約登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0441D021_5(inETMsg, inContext, "EE");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0441D021_11(inETMsg, inContext, "EF");
			}

		}else if(eventID.equals(EventIDList.IKK0451D016)){
			/** 割引サービス契約料金プラン変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0451D016_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0451D016_4(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0451D022)){
			/** 割引サービス契約登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0451D022_6(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0451D022_7(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK0841C002)){
			/** 割引サービス論理削除振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0841C002_5(inETMsg, inContext, "EE");

		}else if(eventID.equals(EventIDList.IKK0851D001)){
			/** 割引サービス対象サービス登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0851D001_6(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0851D001_16(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK0851D002)){
			/** 割引サービス対象サービス変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0851D002_6(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0851D002_16(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK0931D001)){
			/** サービス提供エリア警告対象住所登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0931D001_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1061D002)){
			/** 通知書内訳登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1061D002_5(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1151C001)){
			/** 加入御礼書発行変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1151C001_5(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1151D001)){
			/** 加入御礼書発行登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1151D001_5(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1371D001)){
			/** データ抽出項目対象サービス変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1371D001_6(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1371D002)){
			/** データ抽出項目対象サービス登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1371D002_6(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1931C002)){
			/** 住所変更申込STB一時保存更新振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1931C002_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1931D001)){
			/** 住所変更申込STB一時保存登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1931D001_3(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK2411D001)){
			/** FTTH通信量超過実績登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2411D001_3(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK2811D001)){
			/** 機器オプションサービス契約登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2811D001_2(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK2811D001_3(inETMsg, inContext, "EC");
			}

		}else if(eventID.equals(EventIDList.IKK2811D019)){
			/** 機器オプションサービス契約料金プラン変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2811D019_2(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK2811D019_3(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK2881C001)){
			/** 住所変更申込機器オプション一時保存更新振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2881C001_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK2881C001_6(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK2881D001)){
			/** 住所変更申込機器オプション一時保存登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2881D001_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK2881D001_6(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IKK2931D001)){
			/** 申込時登録不可契約予約振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2931D001_3(inETMsg, inContext, "EA");

		}

		JSYejbLog.println(JSYejbLog.DEBUG, getClass(), "end:JSYejbKK0791KRCK.invoke");

	}

	/**
	 * IKK0081D003_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D003_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D003_制約ＮＯ13チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D003_13(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D005_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D005_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D005_制約ＮＯ13チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D005_13(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D008_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D008_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D008_制約ＮＯ13チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D008_13(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D017_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D017_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D017_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D017_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D018_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D018_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D018_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D018_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D022_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D022_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D022_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D022_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D071_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D071_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D071_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D071_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D080_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D080_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0081D080_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0081D080_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0081ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0081ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "1";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0081ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0081ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0081ETMsg.STATUS)) {
			inETMsg.set(KK0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0161D011_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0161ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0161D011_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0161ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0161ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0161ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0161ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0161ETMsg.STATUS)) {
			inETMsg.set(KK0161ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0161D011_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0161ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0161D011_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0161ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0161ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "2";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0161ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0161ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0161ETMsg.STATUS)) {
			inETMsg.set(KK0161ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0161D031_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0161ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0161D031_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0161ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0161ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0161ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0161ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0161ETMsg.STATUS)) {
			inETMsg.set(KK0161ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0161D031_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0161ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0161D031_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0161ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0161ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "2";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0161ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0161ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0161ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0161ETMsg.STATUS)) {
			inETMsg.set(KK0161ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341C004_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341C004_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D002_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D002_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D002_制約ＮＯ14チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D002_14(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "4";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D015_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D015_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D015_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D015_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "4";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D018_制約ＮＯ7チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D018_7(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D018_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D018_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "4";
			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D003_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D003_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D003_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D003_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "3";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D003_制約ＮＯ15チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D003_15(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(KK0351ETMsg.OP_SVC_CD)){
				joken4_1 = inETMsg.getObject(KK0351ETMsg.OP_SVC_CD).toString();
			}

			String joken4_2 = "B020";

			// 制約部品引数定義
			// チェック条件
			if ((!inETMsg.isNull(KK0351ETMsg.OP_SVC_KEI_NO) && !inETMsg.isNull(KK0351ETMsg.PCRS_CD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(JKKModelCommon.isPcrsChangeCheckKK0351(inETMsg, inContext ) == false){
					inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D007_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D007_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D007_制約ＮＯ11チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D007_11(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "3";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D008_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D008_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D008_制約ＮＯ11チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D008_11(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "3";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D012_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D012_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D012_制約ＮＯ10チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D012_10(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "3";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D023_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D023_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D023_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D023_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "3";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D023_制約ＮＯ11チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D023_11(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(KK0351ETMsg.OP_SVC_CD)){
				joken4_1 = inETMsg.getObject(KK0351ETMsg.OP_SVC_CD).toString();
			}

			String joken4_2 = "B020";

			// 制約部品引数定義
			// チェック条件
			if ((!inETMsg.isNull(KK0351ETMsg.OP_SVC_KEI_NO) && !inETMsg.isNull(KK0351ETMsg.PCRS_CD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(JKKModelCommon.isPcrsChangeCheckKK0351(inETMsg, inContext ) == false){
					inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D032_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D032_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0351D032_制約ＮＯ10チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0351ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0351D032_10(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0351ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0351ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "3";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0351ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0351ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0351ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0351ETMsg.STATUS)) {
			inETMsg.set(KK0351ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D002_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D002_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D002_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D002_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "5";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D006_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D006_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D006_制約ＮＯ9チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D006_9(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "5";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D018_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D018_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D018_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D018_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "5";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D019_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D019_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D019_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D019_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "5";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D020_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D020_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0401D020_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0401ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0401D020_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0401ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0401ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "5";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0401ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0401ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0401ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0401ETMsg.STATUS)) {
			inETMsg.set(KK0401ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0441D001_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0441ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0441D001_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0441ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0441ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0441ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0441ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0441ETMsg.STATUS)) {
			inETMsg.set(KK0441ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0441D001_制約ＮＯ11チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0441ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0441D001_11(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0441ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0441ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "6";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0441ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0441ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0441ETMsg.STATUS)) {
			inETMsg.set(KK0441ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0441D018_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0441ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0441D018_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0441ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0441ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0441ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0441ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0441ETMsg.STATUS)) {
			inETMsg.set(KK0441ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0441D018_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0441ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0441D018_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0441ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0441ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "6";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0441ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0441ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0441ETMsg.STATUS)) {
			inETMsg.set(KK0441ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0441D021_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0441ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0441D021_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0441ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0441ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0441ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0441ETMsg.SYSID_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0441ETMsg.STATUS)) {
			inETMsg.set(KK0441ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0441D021_制約ＮＯ11チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0441ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0441D021_11(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0441ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0441ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "6";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0441ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0441ETMsg.SYSID_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0441ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0441ETMsg.STATUS)) {
			inETMsg.set(KK0441ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0451D016_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0451ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0451D016_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0451ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0451ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0451ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0451ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0451ETMsg.STATUS)) {
			inETMsg.set(KK0451ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0451D016_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0451ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0451D016_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0451ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0451ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "7";
			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0451ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0451ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0451ETMsg.STATUS)) {
			inETMsg.set(KK0451ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0451D022_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0451ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0451D022_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0451ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0451ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0451ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0451ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0451ETMsg.STATUS)) {
			inETMsg.set(KK0451ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0451D022_制約ＮＯ7チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0451ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0451D022_7(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0451ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0451ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "7";
			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0451ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0451ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0451ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0451ETMsg.STATUS)) {
			inETMsg.set(KK0451ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0841C002_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0841ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0841C002_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0841ETMsg.WRIB_SVC_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0841ETMsg.WRIB_SVC_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.WRIB_SVC_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0841ETMsg.WRIB_SVC_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(rsltQuery.getLong("CNT")>0){
						inETMsg.set(KK0841ETMsg.WRIB_SVC_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0841ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0841ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0841ETMsg.STATUS)) {
			inETMsg.set(KK0841ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0851D001_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0851ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0851D001_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0851ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0851ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0851ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0851ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0851ETMsg.STATUS)) {
			inETMsg.set(KK0851ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0851D001_制約ＮＯ16チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0851ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0851D001_16(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0851ETMsg.CHGE_BF_PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0851ETMsg.CHGE_BF_PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0851ETMsg.CHGE_BF_PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0851ETMsg.CHGE_BF_PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0851ETMsg.STATUS)) {
			inETMsg.set(KK0851ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0851D002_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0851ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0851D002_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0851ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0851ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0851ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0851ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0851ETMsg.STATUS)) {
			inETMsg.set(KK0851ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0851D002_制約ＮＯ16チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0851ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0851D002_16(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0851ETMsg.CHGE_BF_PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0851ETMsg.CHGE_BF_PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0851ETMsg.CHGE_BF_PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0851ETMsg.CHGE_BF_PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0851ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0851ETMsg.STATUS)) {
			inETMsg.set(KK0851ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0931D001_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0931ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0931D001_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0931ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0931ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0931ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0931ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0931ETMsg.STATUS)) {
			inETMsg.set(KK0931ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1061D002_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1061ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1061D002_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1061ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1061ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1061ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1061ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1061ETMsg.STATUS)) {
			inETMsg.set(KK1061ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1151C001_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1151ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1151C001_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1151ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1151ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1151ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1151ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1151ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1151ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1151ETMsg.STATUS)) {
			inETMsg.set(KK1151ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1151D001_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1151ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1151D001_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1151ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1151ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1151ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1151ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1151ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1151ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1151ETMsg.STATUS)) {
			inETMsg.set(KK1151ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1371D001_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1371ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1371D001_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1371ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1371ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1371ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1371ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1371ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1371ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1371ETMsg.STATUS)) {
			inETMsg.set(KK1371ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1371D002_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1371ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1371D002_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1371ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1371ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1371ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1371ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1371ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1371ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1371ETMsg.STATUS)) {
			inETMsg.set(KK1371ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1931C002_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1931ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1931C002_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1931ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1931ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1931ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1931ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1931ETMsg.STATUS)) {
			inETMsg.set(KK1931ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1931D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1931ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1931D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1931ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1931ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1931ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1931ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1931ETMsg.STATUS)) {
			inETMsg.set(KK1931ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2411D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2411ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2411D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2411ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2411ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2411ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2411ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2411ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2411ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2411ETMsg.STATUS)) {
			inETMsg.set(KK2411ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2811D001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2811ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2811D001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2811ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2811ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2811ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2811ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2811ETMsg.STATUS)) {
			inETMsg.set(KK2811ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2811D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2811ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2811D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2811ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2811ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "9";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2811ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2811ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2811ETMsg.STATUS)) {
			inETMsg.set(KK2811ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2811D019_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2811ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2811D019_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2811ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2811ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2811ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2811ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2811ETMsg.STATUS)) {
			inETMsg.set(KK2811ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2811D019_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2811ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2811D019_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2811ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2811ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "9";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2811ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2811ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2811ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2811ETMsg.STATUS)) {
			inETMsg.set(KK2811ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2881C001_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2881ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2881C001_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2881ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2881ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2881ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2881ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2881ETMsg.STATUS)) {
			inETMsg.set(KK2881ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2881C001_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2881ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2881C001_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2881ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2881ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "9";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2881ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2881ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2881ETMsg.STATUS)) {
			inETMsg.set(KK2881ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2881D001_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2881ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2881D001_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2881ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2881ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2881ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2881ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2881ETMsg.STATUS)) {
			inETMsg.set(KK2881ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2881D001_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2881ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2881D001_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2881ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2881ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			String joken3_2 = "9";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			String joken_3 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_SBT_CD);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2881ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + "(" + joken_1 + " AND " + joken_2 + " ) " + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2881ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2881ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2881ETMsg.STATUS)) {
			inETMsg.set(KK2881ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2931D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2931ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2931D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(KK0791ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2931ETMsg.PCRS_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2931ETMsg.PCRS_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.PCRS_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = KK0791ETMsg.getDBColumnName(KK0791ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2931ETMsg.PCRS_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(KK0791ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2931ETMsg.PCRS_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2931ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2931ETMsg.STATUS)) {
			inETMsg.set(KK2931ETMsg.STATUS, rtn);
		}

		return rtn;

	}

}

