📄 sectorbean.java
字号:
package com.saleSystem;
import java.util.*;
import java.io.*;
import java.sql.*;
import com.saleSystem.util.*;
/**
*PersonalImformationBean包含和Personal表相关的操作
*/
public class SectorBean
{
private Connection con;
//构造方法,获得数据库的连接。
public SectorBean()
{
this.con=DataBaseConnection.getConnection();
}
/**
*搜索所有的上销售员信息。
*返回由sector值对象组成的Collection
*/
public Collection getAllSector()throws Exception
{
Statement stmt=con.createStatement();
ResultSet rst=stmt.executeQuery("select * from sector");
Collection ret=new ArrayList();
while(rst.next())
{
Sector temp=new Sector();
temp.setName(rst.getString("name"));
temp.setProductCode(rst.getString("productCode"));
ret.add(temp);
}
con.close();
return ret;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -