/*
* This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/).
*/
package ch06.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 ch06.*;
/**
* 针对简历登入页面的后台处理
* 注意:可以同时为Guest登录和管理员登录服务
* @author ShenYK
* @version 1.0
*/
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.ge
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Java Web数据库系统应用开发与实例(源码与视频) (884个子文件)
1、系统演示.avi 31.44MB
1、系统演示.avi 13.81MB
1、系统演示.avi 11.8MB
1、系统演示.avi 11.04MB
1、系统演示.avi 8.35MB
3、共通Servlet.avi 7.92MB
1、系统演示.avi 7.9MB
4、报表打印.avi 7.13MB
3、Servlet的作用.avi 6.49MB
1、编写并部署第一个JSP应用程序.avi 5.67MB
2、注册新用户.avi 5.6MB
3、日志功能.avi 5.3MB
5、如何防止作弊.avi 5.24MB
3、MVC模式.avi 5.1MB
4、保存用户答题状态.avi 5.09MB
4、游戏操作.avi 4.91MB
3、页面框架.avi 4.68MB
4、web.xml.avi 4.65MB
6、Get与Post.avi 4.64MB
5、JSP连接数据库.avi 4.63MB
5、知识点内容预览实现.avi 4.55MB
3、用户合法性校验.avi 4.49MB
5、页面导航编写.avi 4.27MB
6、成绩分布图片处理.avi 4.03MB
1、系统演示.avi 3.98MB
6、共通Servlet编写.avi 3.88MB
1、系统演示.avi 3.79MB
2、系统结构.avi 3.74MB
2、系统处理流.avi 3.62MB
2、和其他邮箱的交互.avi 3.62MB
4、页面动态效果.avi 3.49MB
2、系统菜单级联.avi 3.29MB
2、系统异常处理.avi 3.19MB
6、HTML尺寸不确定性.avi 3.19MB
5、自动变换日期.avi 3.03MB
2、系统文件夹结构.avi 2.96MB
5、选课check.avi 2.91MB
3、根据用户自动迁移.avi 2.7MB
5、帮助信息.avi 2.5MB
4、设置删除Flg.avi 2.3MB
4、多画面迁移到发邮件.avi 2.22MB
2、设置开发环境变量.avi 2.18MB
3、留言板.avi 2.13MB
3、数据访问模块.avi 2.09MB
4、表单与页面交互.avi 1.86MB
4、模糊查询功能.avi 1.68MB
7、Javascript脚本.avi 1.48MB
2、系统结构.avi 1.07MB
MResume.class 12KB
MInbox.class 8KB
MInbox.class 8KB
LOrder.class 7KB
DItem.class 7KB
DCustomer.class 7KB
CommonServlet.class 6KB
MComposite.class 6KB
MComposite.class 6KB
DQuestion.class 6KB
LStorage.class 5KB
ChooseCourse.class 5KB
CommonServlet.class 5KB
CommonServlet.class 5KB
MAddress.class 5KB
MAddress.class 5KB
DFeedback.class 5KB
CommonServlet.class 5KB
DIncome.class 5KB
DCategory.class 4KB
MSetting.class 4KB
MSetting.class 4KB
AddCourse.class 4KB
DStorage.class 4KB
ResumeContent.class 4KB
DRecord.class 4KB
DVendor.class 4KB
LVendor.class 4KB
DOrder.class 4KB
DItemControl.class 4KB
AItemVendor.class 4KB
MSendbox.class 4KB
MSendbox.class 4KB
AItemModify.class 4KB
LQuestion.class 4KB
CommonConst.class 3KB
MSetting.class 3KB
ViewCourse.class 3KB
Login.class 3KB
Course.class 3KB
AFeedbackList.class 3KB
AIncomeList.class 3KB
AAdminQuestionList.class 3KB
AMenu.class 3KB
Inbox.class 3KB
CourseList.class 3KB
Inbox.class 3KB
AVendorModify.class 3KB
CRegister.class 3KB
LItem.class 3KB
CGuestRegister.class 3KB
AExamineeTest.class 3KB
共 884 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
业余草
- 粉丝: 1w+
- 资源: 980
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功