基本信息
源码名称:jsp简历管理系统源码下载(含数据库脚本)
源码大小:1.17M
文件格式:.rar
开发语言:Java
更新时间:2016-01-21
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
源码在ResumeSystem.war文件中,解压该文件即可看到源码
源码在ResumeSystem.war文件中,解压该文件即可看到源码
package ResumeSystem.module;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.*;
import java.text.*;
import javax.servlet.http.HttpSession;
import ResumeSystem.*;
public class MResume extends MCommon
{
//guest登录简历的情况
public boolean registerGuestResume ( HttpSession mySession,
ResumeContent resumeObj )
{
//设置用户信息
Hashtable myValues = (Hashtable)mySession.getAttribute(CommonConst.VIEWID_GUEST_REGISTER);
//登录简历
ResumeContent resumeFinish = register( mySession, resumeObj);
//如果登录成功
if ( resumeFinish.getResumeId() != null && resumeFinish.getResumeId().length() > 0 )
{
myValues.put( "resume", resumeFinish );
return true;
}
else
{
myValues.put( "resume", resumeObj);
return false;
}
}
//管理员登录简历的情况
public boolean registerAdminResume ( HttpSession mySession,
ResumeContent resumeObj )
{
//设置用户信息
Hashtable myValues = (Hashtable)mySession.getAttribute(CommonConst.VIEWID_REGISTER_DETAIL);
//登录简历
ResumeContent resumeFinish = register( mySession, resumeObj);
//如果登录成功
if ( resumeFinish.getResumeId() != null && resumeFinish.getResumeId().length() > 0 )
{
myValues.put( "resume", resumeFinish );
return true;
}
else
{
myValues.put( "resume", resumeObj);
return false;
}
}
//登录简历
private synchronized ResumeContent register( HttpSession mySession, ResumeContent resumeObj)
{
//获得数据库连接
Connection conn = this.getDBConnection( mySession );
if ( conn == null )
{
return resumeObj;
}
Statement stmt = null;
ResultSet rs = null;
try
{
//得到当前系统时间
String sDate = (new SimpleDateFormat("yyyy/MM/dd")).format(new Date(System.currentTimeMillis()));
//获得数据库中简历的最大id
String sResumeId = "";
stmt = conn.createStatement();
//执行SQL语句
String sQuery = "select max(resume_id) from resume";
rs = stmt.executeQuery( sQuery );
rs.next();
String sCurrentMaxId = rs.getString(1);
//当前是第一次登录
if ( sCurrentMaxId == null )
{
sResumeId = "00000001";
}
else
{
int iMaxCd = Integer.parseInt(sCurrentMaxId);
sResumeId = String.valueOf(iMaxCd 1);
int iLength = sResumeId.length();
for(int i=8; i>iLength; i--)
{
sResumeId = "0" sResumeId;
}
}
//尝试插入数据库
StringBuffer sInsertSQL = new StringBuffer();
sInsertSQL.append( "insert into resume set ");
sInsertSQL.append( "resume_id = '" sResumeId "', ");
sInsertSQL.append( "realname = '" resumeObj.getRealname() "', " );
sInsertSQL.append( "sex = '" resumeObj.getSex() "', " );
sInsertSQL.append( "born_date = '" resumeObj.getBornDate() "', " );
sInsertSQL.append( "max_education = '" resumeObj.getMaxEducation() "', " );
sInsertSQL.append( "major = '" resumeObj.getMajor() "', " );
sInsertSQL.append( "email = '" resumeObj.getEmail() "', " );
sInsertSQL.append( "contact_phone = '" resumeObj.getContactPhone() "', " );
sInsertSQL.append( "mobile = '" resumeObj.getMobile() "', " );
sInsertSQL.append( "current_job_type = '" resumeObj.getCurrentJobType() "', " );
sInsertSQL.append( "expect_job_type = '" resumeObj.getExpectJobType() "', " );
sInsertSQL.append( "current_position = '" resumeObj.getCurrentPosition() "', " );
sInsertSQL.append( "expect_position = '" resumeObj.getExpectPosition() "', " );
sInsertSQL.append( "current_city = '" resumeObj.getCurrentCity() "', " );
sInsertSQL.append( "expect_city = '" resumeObj.getExpectCity() "', " );
sInsertSQL.append( "expect_salary = '" resumeObj.getExpectSalary() "', " );
sInsertSQL.append( "resume_content = '" resumeObj.getResumeContent() "', " );
sInsertSQL.append( "expire_time = '" resumeObj.getExpireTime() "', " );
sInsertSQL.append( "add_time = '" sDate "'" );
stmt.executeUpdate( sInsertSQL.toString() );
resumeObj.setResumeId(sResumeId);
return resumeObj;
}
catch(Exception e)
{
e.printStackTrace();
mySession.setAttribute("errMsg","往数据库中添加新简历的时候出现错误,请联系技术人员!");
return resumeObj;
}
finally
{
try
{
rs.close();
stmt.close();
conn.close();
}catch(Exception ex)
{
}
}
}
//得到所有未处理的简历一览
public boolean getAllProcessResume( HttpSession mySession )
{
//设置用户信息
Hashtable myValues = (Hashtable)mySession.getAttribute(CommonConst.VIEWID_PROCESS_LIST);
//获得数据库连接
Connection conn = this.getDBConnection( mySession );
if ( conn == null )
{
return false;
}
Statement stmt = null;
ResultSet rs = null;
try
{
stmt = conn.createStatement();
//执行SQL语句
String sQuery = "select * from resume where expire_time='' order by resume_id desc";
rs = stmt.executeQuery( sQuery );
Vector processResumes = new Vector();
//循环取得所有未整理的简历
while ( rs.next() )
{
ResumeContent resumeObj = new ResumeContent();
resumeObj.setResumeId( rs.getString("resume_id") );
resumeObj.setRealname( rs.getString("realname") );
resumeObj.setSex( rs.getString("sex") );
resumeObj.setBornDate( rs.getString("born_date") );
resumeObj.setMaxEducation( rs.getString("max_education") );
resumeObj.setMajor( rs.getString("major") );
resumeObj.setEmail( rs.getString("email") );
resumeObj.setContactPhone( rs.getString("contact_phone") );
resumeObj.setMobile( rs.getString("mobile") );
resumeObj.setCurrentJobType( rs.getString("current_job_type") );
resumeObj.setExpectJobType( rs.getString("expect_job_type") );
resumeObj.setCurrentPosition( rs.getString("current_position") );
resumeObj.setExpectPosition( rs.getString("expect_position") );
resumeObj.setCurrentCity( rs.getString("current_city") );
resumeObj.setExpectCity( rs.getString("expect_city") );
resumeObj.setExpectSalary( rs.getString("expect_salary") );
resumeObj.setResumeContent( rs.getString("resume_content") );
resumeObj.setAddTime( rs.getString("add_time") );
processResumes.add( resumeObj );
}
//放入页面值域
myValues.put( "resumes", processResumes );
//计算总页数
int countPerPage = ((Integer)mySession.getAttribute( "countPerPage" )).intValue();
int totalResumes = processResumes.size();
int totalPage = 0;
if ( totalResumes % countPerPage == 0 )
{
totalPage = totalResumes/countPerPage;
}
else
{
totalPage = totalResumes/countPerPage 1;
}
int curPage = 0;
//放入当前页码
myValues.put( "curPage", new Integer(curPage) );
//放入总页码
myValues.put( "totalPage", new Integer(totalPage) );
return true;
}
catch(Exception e)
{
e.printStackTrace();
mySession.setAttribute("errMsg","在数据库中查找待处理简历的时候出现错误,请联系技术人员!");
return false;
}
finally
{
try
{
rs.close();
stmt.close();
conn.close();
}catch(Exception ex)
{
}
}
}
//设置用户过期时间
public boolean processResume( HttpSession mySession, String resumeId, String expireTime)
{
//获得数据库连接
Connection conn = this.getDBConnection( mySession );
if ( conn == null )
{
return false;
}
Statement stmt = null;
ResultSet rs = null;
try
{
stmt = conn.createStatement();
//尝试修改数据库
String sUpdateSQL = "update resume set expire_time='" expireTime "' where resume_id='" resumeId "'";
stmt.executeUpdate( sUpdateSQL );
return true;
}
catch(Exception e)
{
e.printStackTrace();
mySession.setAttribute("errMsg","处理简历的时候出现错误,请联系技术人员!");
return false;
}
finally
{
try
{
rs.close();
stmt.close();
conn.close();
}catch(Exception ex)
{
}
}
}
//删除简历
public boolean deleteResume( HttpSession mySession, String resumeId )
{
//获得数据库连接
Connection conn = this.getDBConnection( mySession );
if ( conn == null )
{
return false;
}
Statement stmt = null;
ResultSet rs = null;
try
{
stmt = conn.createStatement();
//尝试修改数据库
String sUpdateSQL = "delete from resume where resume_id='" resumeId "'";
stmt.executeUpdate( sUpdateSQL );
return true;
}
catch(Exception e)
{
e.printStackTrace();
mySession.setAttribute("errMsg","抛弃简历的时候出现错误,请联系技术人员!");
return false;
}
finally
{
try
{
rs.close();
stmt.close();
conn.close();
}catch(Exception ex)
{
}
}
}
//得到所有过期简历一览
public boolean getAllExpireResume( HttpSession mySession )
{
//设置用户信息
Hashtable myValues = (Hashtable)mySession.getAttribute(CommonConst.VIEWID_EXPIRE_LIST);
//获得数据库连接
Connection conn = this.getDBConnection( mySession );
if ( conn == null )
{
return false;
}
Statement stmt = null;
ResultSet rs = null;
try
{
//得到当前系统时间
String sDate = (new SimpleDateFormat("yyyy/MM/dd")).format(new Date(System.currentTimeMillis()));
stmt = conn.createStatement();
//执行SQL语句
String sQuery = "select * from resume where expire_time<>'' and expire_time<'" sDate "' order by resume_id desc";
rs = stmt.executeQuery( sQuery );
Vector processResumes = new Vector();
//循环取得所有过期的简历
while ( rs.next() )
{
ResumeContent resumeObj = new ResumeContent();
resumeObj.setResumeId( rs.getString("resume_id") );
resumeObj.setRealname( rs.getString("realname") );
resumeObj.setSex( rs.getString("sex") );
resumeObj.setBornDate( rs.getString("born_date") );
resumeObj.setMaxEducation( rs.getString("max_education") );
resumeObj.setMajor( rs.getString("major") );
resumeObj.setEmail( rs.getString("email") );
resumeObj.setContactPhone( rs.getString("contact_phone") );
resumeObj.setMobile( rs.getString("mobile") );
resumeObj.setCurrentJobType( rs.getString("current_job_type") );
resumeObj.setExpectJobType( rs.getString("expect_job_type") );
resumeObj.setCurrentPosition( rs.getString("current_position") );
resumeObj.setExpectPosition( rs.getString("expect_position") );
resumeObj.setCurrentCity( rs.getString("current_city") );
resumeObj.setExpectCity( rs.getString("expect_city") );
resumeObj.setExpectSalary( rs.getString("expect_salary") );
resumeObj.setResumeContent( rs.getString("resume_content") );
resumeObj.setExpireTime( rs.getString("expire_time") );
resumeObj.setAddTime( rs.getString("add_time") );
processResumes.add( resumeObj );
}
//放入页面值域
myValues.put( "resumes", processResumes );
//计算总页数
int countPerPage = ((Integer)mySession.getAttribute( "countPerPage" )).intValue();
int totalResumes = processResumes.size();
int totalPage = 0;
if ( totalResumes % countPerPage == 0 )
{
totalPage = totalResumes/countPerPage;
}
else
{
totalPage = totalResumes/countPerPage 1;
}
int curPage = 0;
//放入当前页码
myValues.put( "curPage", new Integer(curPage) );
//放入总页码
myValues.put( "totalPage", new Integer(totalPage) );
return true;
}
catch(Exception e)
{
e.printStackTrace();
mySession.setAttribute("errMsg","在数据库中查找过期简历的时候出现错误,请联系技术人员!");
return false;
}
finally
{
try
{
rs.close();
stmt.close();
conn.close();
}catch(Exception ex)
{
}
}
}
//根据检索条件获得对应的简历
public boolean searchResume( HttpSession mySession,
String sResumeId1,
String sResumeId2,
String sRealname,
String sSex,
String sMaxEducation,
String sMajor,
String sCurrentJobType,
String sCurrentCity )
{
//设置用户信息
Hashtable myValues = (Hashtable)mySession.getAttribute(CommonConst.VIEWID_VIEW_LIST);
//获得数据库连接
Connection conn = this.getDBConnection( mySession );
if ( conn == null )
{
return false;
}
Statement stmt = null;
ResultSet rs = null;
try
{
stmt = conn.createStatement();
//组合SQL语句
StringBuffer sQuery = new StringBuffer();
sQuery.append( "select * from resume where 1=1 ");
if ( sResumeId1 != null && !sResumeId1.equals("") )
{
sQuery.append( "and resume_id>='" sResumeId1 "' ");
}
if ( sResumeId2 != null && !sResumeId2.equals("") )
{
sQuery.append( "and resume_id<='" sResumeId2 "' ");
}
if ( sRealname != null && !sRealname.equals("") )
{
sQuery.append( "and realname like '%" sRealname "%' ");
}
if ( sSex != null && !sSex.equals("") )
{
sQuery.append( "and sex='" sSex "' ");
}
if ( sMaxEducation != null && !sMaxEducation.equals("") )
{
sQuery.append( "and max_education like '%" sMaxEducation "%' ");
}
if ( sMajor != null && !sMajor.equals("") )
{
sQuery.append( "and major like '%" sMajor "%' ");
}
if ( sCurrentJobType != null && !sCurrentJobType.equals("") )
{
sQuery.append( "and current_job_type like '%" sCurrentJobType "%' ");
}
if ( sCurrentCity != null && !sCurrentCity.equals("") )
{
sQuery.append( "and current_city like '%" sCurrentCity "%' ");
}
sQuery.append("order by resume_id desc");
//执行SQL语句
rs = stmt.executeQuery( sQuery.toString() );
Vector processResumes = new Vector();
//循环取得所有检索到的简历
while ( rs.next() )
{
ResumeContent resumeObj = new ResumeContent();
resumeObj.setResumeId( rs.getString("resume_id") );
resumeObj.setRealname( rs.getString("realname") );
resumeObj.setSex( rs.getString("sex") );
resumeObj.setBornDate( rs.getString("born_date") );
resumeObj.setMaxEducation( rs.getString("max_education") );
resumeObj.setMajor( rs.getString("major") );
resumeObj.setEmail( rs.getString("email") );
resumeObj.setContactPhone( rs.getString("contact_phone") );
resumeObj.setMobile( rs.getString("mobile") );
resumeObj.setCurrentJobType( rs.getString("current_job_type") );
resumeObj.setExpectJobType( rs.getString("expect_job_type") );
resumeObj.setCurrentPosition( rs.getString("current_position") );
resumeObj.setExpectPosition( rs.getString("expect_position") );
resumeObj.setCurrentCity( rs.getString("current_city") );
resumeObj.setExpectCity( rs.getString("expect_city") );
resumeObj.setExpectSalary( rs.getString("expect_salary") );
resumeObj.setResumeContent( rs.getString("resume_content") );
resumeObj.setExpireTime( rs.getString("expire_time") );
processResumes.add( resumeObj );
}
//如果一条也没有查找出来
if ( processResumes.size() == 0 )
{
mySession.setAttribute("errMsg","共查找到0条记录,请重新指定查询条件。");
return false;
}
//放入页面值域
myValues.put( "resumes", processResumes );
//计算总页数
int countPerPage = ((Integer)mySession.getAttribute( "countPerPage" )).intValue();
int totalResumes = processResumes.size();
int totalPage = 0;
if ( totalResumes % countPerPage == 0 )
{
totalPage = totalResumes/countPerPage;
}
else
{
totalPage = totalResumes/countPerPage 1;
}
int curPage = 0;
//放入当前页码
myValues.put( "curPage", new Integer(curPage) );
//放入总页码
myValues.put( "totalPage", new Integer(totalPage) );
return true;
}
catch(Exception e)
{
e.printStackTrace();
mySession.setAttribute("errMsg","在数据库中查找简历的时候出现错误,请联系技术人员!");
return false;
}
finally
{
try
{
rs.close();
stmt.close();
conn.close();
}catch(Exception ex)
{
}
}
}
}