⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 running_numberbeanfunctionset_4095c903.java

📁 j2ee源码
💻 JAVA
字号:
package com.leeman.wkexs.common.dao.websphere_deploy.ORACLE_V9_1;import com.ibm.websphere.rsadapter.WSInteractionSpec;import com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException;import javax.resource.cci.Record;import javax.resource.cci.IndexedRecord;import java.sql.*;/** * Running_NumberBeanFunctionSet_4095c903 */public class Running_NumberBeanFunctionSet_4095c903 extends com.ibm.ws.rsadapter.cci.WSResourceAdapterBase implements com.ibm.websphere.rsadapter.DataAccessFunctionSet {	private java.util.HashMap functionHash;	/**	 * Create	 */	public void Create(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException {		PreparedStatement pstmt = null;		try {			pstmt = prepareStatement(connection,"INSERT INTO WKEXS.RUNNING_NUMBER (COMPANY_ID, RUNNING_TYPE, RUNNING_YEAR, LAST_USED_NO, MIN_VALUE, MAX_VALUE, RECYCLE, INCREMENT_BY, RUNNING_DESC) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");			// For column COMPANY_ID			{				String tempString;				tempString=(String)inputRecord.get(0);				if(tempString==null)					pstmt.setNull(1,java.sql.Types.VARCHAR);				else					pstmt.setString(1,tempString);			}			// For column RUNNING_TYPE			{				String tempString;				tempString=(String)inputRecord.get(1);				if(tempString==null)					pstmt.setNull(2,java.sql.Types.VARCHAR);				else					pstmt.setString(2,tempString);			}			// For column RUNNING_YEAR			{				String tempString;				tempString=(String)inputRecord.get(2);				if(tempString==null)					pstmt.setNull(3,java.sql.Types.VARCHAR);				else					pstmt.setString(3,tempString);			}			// For column LAST_USED_NO			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(3);				if(tempDouble==null)					pstmt.setNull(4,java.sql.Types.DECIMAL);				else					pstmt.setDouble(4,tempDouble.doubleValue());			}			// For column MIN_VALUE			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(4);				if(tempDouble==null)					pstmt.setNull(5,java.sql.Types.DECIMAL);				else					pstmt.setDouble(5,tempDouble.doubleValue());			}			// For column MAX_VALUE			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(5);				if(tempDouble==null)					pstmt.setNull(6,java.sql.Types.DECIMAL);				else					pstmt.setDouble(6,tempDouble.doubleValue());			}			// For column RECYCLE			{				String tempString;				tempString=(String)inputRecord.get(6);				if(tempString==null)					pstmt.setNull(7,java.sql.Types.VARCHAR);				else					pstmt.setString(7,tempString);			}			// For column INCREMENT_BY			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(7);				if(tempDouble==null)					pstmt.setNull(8,java.sql.Types.DECIMAL);				else					pstmt.setDouble(8,tempDouble.doubleValue());			}			// For column RUNNING_DESC			{				String tempString;				tempString=(String)inputRecord.get(8);				if(tempString==null)					pstmt.setNull(9,java.sql.Types.VARCHAR);				else					pstmt.setString(9,tempString);			}			if (pstmt.executeUpdate()==0)				throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass());		}		catch (SQLException e) {			throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass());		}		finally {			try {				if(pstmt != null) {					returnPreparedStatement(connection, pstmt);				}			}			catch (SQLException ignored)			{}		}	}	/**	 * Remove	 */	public void Remove(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException {		PreparedStatement pstmt = null;		try {			pstmt = prepareStatement(connection,"DELETE FROM WKEXS.RUNNING_NUMBER  WHERE COMPANY_ID = ? AND RUNNING_TYPE = ? AND RUNNING_YEAR = ?");			// For column COMPANY_ID			{				String tempString;				tempString=(String)inputRecord.get(0);				if(tempString==null)					pstmt.setNull(1,java.sql.Types.VARCHAR);				else					pstmt.setString(1,tempString);			}			// For column RUNNING_TYPE			{				String tempString;				tempString=(String)inputRecord.get(1);				if(tempString==null)					pstmt.setNull(2,java.sql.Types.VARCHAR);				else					pstmt.setString(2,tempString);			}			// For column RUNNING_YEAR			{				String tempString;				tempString=(String)inputRecord.get(2);				if(tempString==null)					pstmt.setNull(3,java.sql.Types.VARCHAR);				else					pstmt.setString(3,tempString);			}			if (pstmt.executeUpdate()==0)				throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass());		}		catch (SQLException e) {			throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass());		}		finally {			try {				if(pstmt != null) {					returnPreparedStatement(connection, pstmt);				}			}			catch (SQLException ignored)			{}		}	}	/**	 * Store	 */	public void Store(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException {		PreparedStatement pstmt = null;		try {			pstmt = prepareStatement(connection,"UPDATE WKEXS.RUNNING_NUMBER  SET LAST_USED_NO = ?, MIN_VALUE = ?, MAX_VALUE = ?, RECYCLE = ?, INCREMENT_BY = ?, RUNNING_DESC = ? WHERE COMPANY_ID = ? AND RUNNING_TYPE = ? AND RUNNING_YEAR = ?");			// For column COMPANY_ID			{				String tempString;				tempString=(String)inputRecord.get(0);				if(tempString==null)					pstmt.setNull(7,java.sql.Types.VARCHAR);				else					pstmt.setString(7,tempString);			}			// For column RUNNING_TYPE			{				String tempString;				tempString=(String)inputRecord.get(1);				if(tempString==null)					pstmt.setNull(8,java.sql.Types.VARCHAR);				else					pstmt.setString(8,tempString);			}			// For column RUNNING_YEAR			{				String tempString;				tempString=(String)inputRecord.get(2);				if(tempString==null)					pstmt.setNull(9,java.sql.Types.VARCHAR);				else					pstmt.setString(9,tempString);			}			// For column LAST_USED_NO			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(3);				if(tempDouble==null)					pstmt.setNull(1,java.sql.Types.DECIMAL);				else					pstmt.setDouble(1,tempDouble.doubleValue());			}			// For column MIN_VALUE			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(4);				if(tempDouble==null)					pstmt.setNull(2,java.sql.Types.DECIMAL);				else					pstmt.setDouble(2,tempDouble.doubleValue());			}			// For column MAX_VALUE			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(5);				if(tempDouble==null)					pstmt.setNull(3,java.sql.Types.DECIMAL);				else					pstmt.setDouble(3,tempDouble.doubleValue());			}			// For column RECYCLE			{				String tempString;				tempString=(String)inputRecord.get(6);				if(tempString==null)					pstmt.setNull(4,java.sql.Types.VARCHAR);				else					pstmt.setString(4,tempString);			}			// For column INCREMENT_BY			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(7);				if(tempDouble==null)					pstmt.setNull(5,java.sql.Types.DECIMAL);				else					pstmt.setDouble(5,tempDouble.doubleValue());			}			// For column RUNNING_DESC			{				String tempString;				tempString=(String)inputRecord.get(8);				if(tempString==null)					pstmt.setNull(6,java.sql.Types.VARCHAR);				else					pstmt.setString(6,tempString);			}			if (pstmt.executeUpdate()==0)				throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass());		}		catch (SQLException e) {			throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass());		}		finally {			try {				if(pstmt != null) {					returnPreparedStatement(connection, pstmt);				}			}			catch (SQLException ignored)			{}		}	}	/**	 * StoreUsingOCC	 */	public void StoreUsingOCC(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException {		PreparedStatement pstmt = null;		try {			pstmt = prepareStatement(connection,"UPDATE WKEXS.RUNNING_NUMBER  SET LAST_USED_NO = ?, MIN_VALUE = ?, MAX_VALUE = ?, RECYCLE = ?, INCREMENT_BY = ?, RUNNING_DESC = ? WHERE COMPANY_ID = ? AND RUNNING_TYPE = ? AND RUNNING_YEAR = ?");			// For column COMPANY_ID			{				String tempString;				tempString=(String)inputRecord.get(0);				if(tempString==null)					pstmt.setNull(7,java.sql.Types.VARCHAR);				else					pstmt.setString(7,tempString);			}			// For column RUNNING_TYPE			{				String tempString;				tempString=(String)inputRecord.get(1);				if(tempString==null)					pstmt.setNull(8,java.sql.Types.VARCHAR);				else					pstmt.setString(8,tempString);			}			// For column RUNNING_YEAR			{				String tempString;				tempString=(String)inputRecord.get(2);				if(tempString==null)					pstmt.setNull(9,java.sql.Types.VARCHAR);				else					pstmt.setString(9,tempString);			}			// For column LAST_USED_NO			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(3);				if(tempDouble==null)					pstmt.setNull(1,java.sql.Types.DECIMAL);				else					pstmt.setDouble(1,tempDouble.doubleValue());			}			// For column MIN_VALUE			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(4);				if(tempDouble==null)					pstmt.setNull(2,java.sql.Types.DECIMAL);				else					pstmt.setDouble(2,tempDouble.doubleValue());			}			// For column MAX_VALUE			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(5);				if(tempDouble==null)					pstmt.setNull(3,java.sql.Types.DECIMAL);				else					pstmt.setDouble(3,tempDouble.doubleValue());			}			// For column RECYCLE			{				String tempString;				tempString=(String)inputRecord.get(6);				if(tempString==null)					pstmt.setNull(4,java.sql.Types.VARCHAR);				else					pstmt.setString(4,tempString);			}			// For column INCREMENT_BY			{				Double tempDouble;				tempDouble=(Double)inputRecord.get(7);				if(tempDouble==null)					pstmt.setNull(5,java.sql.Types.DECIMAL);				else					pstmt.setDouble(5,tempDouble.doubleValue());			}			// For column RUNNING_DESC			{				String tempString;				tempString=(String)inputRecord.get(8);				if(tempString==null)					pstmt.setNull(6,java.sql.Types.VARCHAR);				else					pstmt.setString(6,tempString);			}			IndexedRecord oldRecord = interactionSpec.getOldRecord();			if (pstmt.executeUpdate()==0)				throw new DataStoreAdapterException("DSA_ERROR",new javax.ejb.NoSuchEntityException(), this.getClass());		}		catch (SQLException e) {			throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass());		}		finally {			try {				if(pstmt != null) {					returnPreparedStatement(connection, pstmt);				}			}			catch (SQLException ignored)			{}		}	}	/**	 * FindByPrimaryKey	 */	public javax.resource.cci.Record FindByPrimaryKey(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException {		PreparedStatement pstmt = null;		ResultSet result=null;		try {			pstmt = prepareStatement(connection,"SELECT T1.COMPANY_ID, T1.RUNNING_TYPE, T1.RUNNING_YEAR, T1.LAST_USED_NO, T1.MIN_VALUE, T1.MAX_VALUE, T1.RECYCLE, T1.INCREMENT_BY, T1.RUNNING_DESC FROM WKEXS.RUNNING_NUMBER  T1 WHERE T1.COMPANY_ID = ? AND T1.RUNNING_TYPE = ? AND T1.RUNNING_YEAR = ?");			// For column COMPANY_ID			{				String tempString;				tempString=(String)inputRecord.get(0);				if(tempString==null)					pstmt.setNull(1,java.sql.Types.VARCHAR);				else					pstmt.setString(1,tempString);			}			// For column RUNNING_TYPE			{				String tempString;				tempString=(String)inputRecord.get(1);				if(tempString==null)					pstmt.setNull(2,java.sql.Types.VARCHAR);				else					pstmt.setString(2,tempString);			}			// For column RUNNING_YEAR			{				String tempString;				tempString=(String)inputRecord.get(2);				if(tempString==null)					pstmt.setNull(3,java.sql.Types.VARCHAR);				else					pstmt.setString(3,tempString);			}			result = pstmt.executeQuery();		}		catch (SQLException e) {			throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass());		}		return createCCIRecord(connection, result);	}	/**	 * FindByPrimaryKeyForUpdate	 */	public javax.resource.cci.Record FindByPrimaryKeyForUpdate(IndexedRecord inputRecord, Object connection, WSInteractionSpec interactionSpec) throws DataStoreAdapterException {		PreparedStatement pstmt = null;		ResultSet result=null;		try {			pstmt = prepareStatement(connection,"SELECT T1.COMPANY_ID, T1.RUNNING_TYPE, T1.RUNNING_YEAR, T1.LAST_USED_NO, T1.MIN_VALUE, T1.MAX_VALUE, T1.RECYCLE, T1.INCREMENT_BY, T1.RUNNING_DESC FROM WKEXS.RUNNING_NUMBER  T1 WHERE T1.COMPANY_ID = ? AND T1.RUNNING_TYPE = ? AND T1.RUNNING_YEAR = ? FOR UPDATE ");			// For column COMPANY_ID			{				String tempString;				tempString=(String)inputRecord.get(0);				if(tempString==null)					pstmt.setNull(1,java.sql.Types.VARCHAR);				else					pstmt.setString(1,tempString);			}			// For column RUNNING_TYPE			{				String tempString;				tempString=(String)inputRecord.get(1);				if(tempString==null)					pstmt.setNull(2,java.sql.Types.VARCHAR);				else					pstmt.setString(2,tempString);			}			// For column RUNNING_YEAR			{				String tempString;				tempString=(String)inputRecord.get(2);				if(tempString==null)					pstmt.setNull(3,java.sql.Types.VARCHAR);				else					pstmt.setString(3,tempString);			}			result = pstmt.executeQuery();		}		catch (SQLException e) {			throw new DataStoreAdapterException("DSA_ERROR", e ,this.getClass());		}		return createCCIRecord(connection, result);	}	/**	 * Running_NumberBeanFunctionSet_4095c903	 */	public Running_NumberBeanFunctionSet_4095c903() {		functionHash=new java.util.HashMap(6);		functionHash.put("Create",new Integer(0));		functionHash.put("Remove",new Integer(1));		functionHash.put("Store",new Integer(2));		functionHash.put("StoreUsingOCC",new Integer(3));		functionHash.put("FindByPrimaryKey",new Integer(4));		functionHash.put("FindByPrimaryKeyForUpdate",new Integer(5));	}	/**	 * execute	 */	public Record execute(WSInteractionSpec interactionSpec, IndexedRecord inputRecord, Object connection) throws javax.resource.ResourceException {		String functionName=interactionSpec.getFunctionName();		Record outputRecord=null;		int functionIndex=((Integer)functionHash.get(functionName)).intValue();		switch (functionIndex) {		case 0:			Create(inputRecord,connection,interactionSpec);			break;		case 1:			Remove(inputRecord,connection,interactionSpec);			break;		case 2:			Store(inputRecord,connection,interactionSpec);			break;		case 3:			StoreUsingOCC(inputRecord,connection,interactionSpec);			break;		case 4:			outputRecord=FindByPrimaryKey(inputRecord,connection,interactionSpec);			break;		case 5:			outputRecord=FindByPrimaryKeyForUpdate(inputRecord,connection,interactionSpec);			break;		}		return outputRecord;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -