package com.means;
import com.tools.ConnectServer;
import com.entityBean.AlumniBean;
import com.entityBean.ClassBean;
import com.entityBean.GradeBean;
import com.entityBean.SchoolBean;
import com.entityBean.SpecialityBean;
import com.entityBean.SystemBean;
import java.sql.*;
import java.sql.ResultSet;
import java.util.*;
public class handleAlumni{
private ConnectServer cons=null;
private int j=0;
public handleAlumni(){
cons=new ConnectServer();
this.cons.buildConnection();
}
//根据校友学号查询校友信息
public AlumniBean fetchAlByNum(String number){
AlumniBean alb=null;
String sql="select * from alumnis_Info where a_number='"+number+"'";
ResultSet rs=cons.queryDB(sql);
try{
while(rs.next()){
alb=new AlumniBean();
alb.setA_id(Integer.valueOf(rs.getString(1)));//取得数据库流水号信息
alb.setA_number(rs.getString(2));//取得校友在校学号信息
alb.setA_name(rs.getString(3));//取得校友姓名
alb.setA_sex(rs.getString(4));//取得校友性别信息
alb.setA_nowwork(rs.getString(5));//取得校友现工作单位信息
alb.setA_level(rs.getString(6));//职务职称信息
alb.setA_phone(rs.getString(7));//联系电话
alb.setA_post(rs.getString(8));//邮编
alb.setA_sy_number(rs.getString(9));//所在院系
alb.setA_sp_number(rs.getString(10));//所在专业
alb.setA_g_name(rs.getString(11));//所在年级
alb.setA_c_number(rs.getString(12));//所在班级
}
}catch(SQLException ex){}
cons.closeConnect();
return alb;
}
//根据所在院系查询校友信息
public List fetchAluBySy(SystemBean syb){
List list=new ArrayList();
AlumniBean alb=null;
String sql="select * from alumnis_Info where a_sy_number='"+syb.getSy_number()+"'";
ResultSet rs=cons.queryDB(sql);
try{
while(rs.next()){
alb=new AlumniBean();
alb.setA_id(Integer.valueOf(rs.getString(1)));//取得数据库流水号信息
alb.setA_number(rs.getString(2));//取得校友在校学号信息
alb.setA_name(rs.getString(3));//取得校友姓名
alb.setA_sex(rs.getString(4));//取得校友性别信息
alb.setA_nowwork(rs.getString(5));//取得校友现工作单位信息
alb.setA_level(rs.getString(6));//职务职称信息
alb.setA_phone(rs.getString(7));//联系电话
alb.setA_post(rs.getString(8));//邮编
alb.setA_sy_number(rs.getString(9));//所在院系
alb.setA_sp_number(rs.getString(10));//所在专业
alb.setA_g_name(rs.getString(11));//所在年级
alb.setA_c_number(rs.getString(12));//所在班级
list.add(alb);
}
}catch(SQLException ex){}
cons.closeConnect();
return list;
}
//根据所在专业查询校友信息
public List fetchAluBySp(SpecialityBean spb){
List list=new ArrayList();
AlumniBean alb=null;
String sql="select * from alumnis_Info where a_sp_number='"+spb.getSp_number()+"'";
ResultSet rs=cons.queryDB(sql);
try{
while(rs.next()){
alb=new AlumniBean();
alb.setA_id(Integer.valueOf(rs.getString(1)));//取得数据库流水号信息
alb.setA_number(rs.getString(2));//取得校友在校学号信息
alb.setA_name(rs.getString(3));//取得校友姓名
alb.setA_sex(rs.getString(4));//取得校友性别信息
alb.setA_nowwork(rs.getString(5));//取得校友现工作单位信息
alb.setA_level(rs.getString(6));//职务职称信息
alb.setA_phone(rs.getString(7));//联系电话
alb.setA_post(rs.getString(8));//邮编
alb.setA_sy_number(rs.getString(9));//所在院系
alb.setA_sp_number(rs.getString(10));//所在专业
alb.setA_g_name(rs.getString(11));//所在年级
alb.setA_c_number(rs.getString(12));//所在班级
list.add(alb);
}
}catch(SQLException ex){}
cons.closeConnect();
return list;
}
//根据所在班级查询校友信息
public List fetchAluByCla(ClassBean cb){
List list=new ArrayList();
AlumniBean alb=null;
String sql="select * from alumnis_Info where a_c_number='"+cb.getC_number()+"'";
ResultSet rs=cons.queryDB(sql);
try{
while(rs.next()){
alb=new AlumniBean();
alb.setA_id(Integer.valueOf(rs.getString(1)));//取得数据库流水号信息
alb.setA_number(rs.getString(2));//取得校友在校学号信息
alb.setA_name(rs.getString(3));//取得校友姓名
alb.setA_sex(rs.getString(4));//取得校友性别信息
alb.setA_nowwork(rs.getString(5));//取得校友现工作单位信息
alb.setA_level(rs.getString(6));//职务职称信息
alb.setA_phone(rs.getString(7));//联系电话
alb.setA_post(rs.getString(8));//邮编
alb.setA_sy_number(rs.getString(9));//所在院系
alb.setA_sp_number(rs.getString(10));//所在专业
alb.setA_g_name(rs.getString(11));//所在年级
alb.setA_c_number(rs.getString(12));//所在班级
list.add(alb);
}
}catch(SQLException ex){}
cons.closeConnect();
return list;
}
//根据所在年级和所在专业查询校友信息
public List fetchAluByGC(String gnumber,String spnumber){
List list=new ArrayList();
AlumniBean alb=null;
String sql="select * from alumnis_Info where a_sp_number='"+spnumber+"' and a_g_name='"+gnumber+"'";
ResultSet rs=cons.queryDB(sql);
try{
while(rs.next()){
alb=new AlumniBean();
alb.setA_id(Integer.valueOf(rs.getString(1)));//取得数据库流水号信息
alb.setA_number(rs.getString(2));//取得校友在校学号信息
alb.setA_name(rs.getString(3));//取得校友姓名
alb.setA_sex(rs.getString(4));//取得校友性别信息
alb.setA_nowwork(rs.getString(5));//取得校友现工作单位信息
alb.setA_level(rs.getString(6));//职务职称信息
alb.setA_phone(rs.getString(7));//联系电话
alb.setA_post(rs.getString(8));//邮编
alb.setA_sy_number(rs.getString(9));//所在院系
alb.setA_sp_number(rs.getString(10));//所在专业
alb.setA_g_name(rs.getString(11));//所在年级
alb.setA_c_number(rs.getString(12));//所在班级
list.add(alb);
}
}catch(SQLException ex){}
cons.closeConnect();
return list;
}
//匹配校友姓名进行模糊查询
public List fetchAluByName(String name){
List list=new ArrayList();
AlumniBean alb=null;
String sql="select * from alumnis_Info where a_name like '%"+name+"%'";
ResultSet rs=cons.queryDB(sql);
try{
while(rs.next()){
alb=new AlumniBean();
alb.setA_id(Integer.valueOf(rs.getString(1)));//取得数据库流水号信息
alb.setA_number(rs.getString(2));//取得校友在校学号信息
alb.setA_name(rs.getString(3));//取得校友姓名
alb.setA_sex(rs.getString(4));//取得校友性别信息
alb.setA_nowwork(rs.getString(5));//取得校友现工作单位信息
alb.setA_level(rs.getString(6));//职务职称信息
alb.setA_phone(rs.getString(7));//联系电话
alb.setA_post(rs.getString(8));//邮编
alb.setA_sy_number(rs.getString(9));//所在院系
alb.setA_sp_number(rs.getString(10));//所在专业
alb.setA_g_name(rs.getString(11));//所在年级
alb.setA_c_number(rs.getString(12));//所在班级
list.add(alb);
}
}catch(SQLException ex){}
cons.closeConnect();
return list;
}
//匹配校友工作单位进行模糊查询
public List fetchAluByWork(String work){
List list=new ArrayList();
评论17
最新资源