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

📄 personalinformationbean.java

📁 《JSP程序设计实用教程》-梁建武-源代码(补充)-4567.rar
💻 JAVA
字号:
package com.saleSystem;
import java.util.*;
import java.io.*;
import java.sql.*;
import com.saleSystem.util.*;

/**
 *PersonalImformationBean包含和Personal表相关的操作
 */
public class PersonalInformationBean
{
	private Connection con;
	//构造方法,获得数据库的连接。
	public PersonalInformationBean()
	{
		this.con=DataBaseConnection.getConnection();
	}
	/**
	 *搜索所有的上销售员信息。
	 *返回由Personal值对象组成的Collection
	 */
	public Collection getAllPersonal()throws Exception
	{
		Statement stmt=con.createStatement();
		ResultSet rst=stmt.executeQuery("select * from Personal");
		Collection ret=new ArrayList();
		while(rst.next())
		{
			Personal temp=new Personal();
			temp.setPersonalCode(rst.getString("personalCode"));
		    temp.setName(rst.getString("name"));
	        temp.setSex(rst.getString("sex"));
	        temp.setAddress(rst.getString("address"));
            temp.setTelephone(rst.getString("telephone"));
			
			ret.add(temp);
		}
		con.close();
		return ret;
	}
	
}

⌨️ 快捷键说明

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