classassiimpl.java

来自「JSP编写的汽车门户系统」· Java 代码 · 共 79 行

JAVA
79
字号
/**
 *  (c) Copyright 2007 computer01
 *
 *   FILENAME     :  ClassAssiImpl.java
 *   PACKAGE      :  com.computer03.entitysupport
 *   CREATE DATE  : 2007-11-21
 *   AUTHOR       :  yufeng
 *   DESCRIPTION  :  由本类来完成对TAB_CLASS 的CRDU操作
 */
package com.computer03.entitysupport;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.computer03.common.Linkdb;
import com.computer03.entity.AllEntity;
import com.computer03.entity.TAB_CLASS;

public class ClassAssiImpl extends TAB_CLASS
 implements EntityAssiInterface{
	/**
	 * 数据库操作类
	 */
	Linkdb linkdb = null;
	/**
	 * 返回学生实体信息列表
	 */

	public void deleteEntity(AllEntity condition) {
		// TODO Auto-generated method stub
		
	}

	public List getEntityList(AllEntity condition) {
		// TODO Auto-generated method stub
		List<AllEntity> allEntityList = new ArrayList<AllEntity>();
		try{
			linkdb = new Linkdb();
			/**
			 * sql
			 */
			StringBuffer buff =
				new StringBuffer();
			buff.append("select cla.CLASSNO,cla.CLASSNAME ")
			.append("from TAB_CLASS cla");
			
			ResultSet rs =
			linkdb.executeQuery(buff.toString());
			while(rs.next()){
				AllEntity allentity =
					new AllEntity();
				 TAB_CLASS tabcla = new TAB_CLASS();
				 tabcla.setCLASSNO(
						 new Integer(rs.getShort(1)));
				 tabcla.setCLASSNAME(rs.getString(2));
				 
				 allentity.setTabclass(tabcla);
				 
				 allEntityList.add(allentity); 
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		return allEntityList;
	}

	public void saveEntity(AllEntity allentity) {
		// TODO Auto-generated method stub
		
	}

	public int updateEntity(AllEntity allentity) {
		// TODO Auto-generated method stub
		return 0;
	}

}

⌨️ 快捷键说明

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