if(ac.equals(“mlogin”))
{
String username = request.getParameter(“uname”);
String password = request.getParameter(“upass”);
List list = dao
.select(“select * from sysuser where uname='”
- username + “'”);
if (list.size() == 1) {
HashMap map = list.get(0);
List ulist = dao
.select(“select * from sysuser where uname='”
-
username + “’ and upass='” + password
-
“'”);
if (ulist.size() == 1&& password.equals(map.get(“upass”).toString())) {
request.getSession().setAttribute(“admin”, map);
gor(“/jsp_qzzp_sys/index.jsp”, request, response);
} else {
request.setAttribute(“error”, “”);
go(“/index.jsp”, request, response);
}
} else {
request.setAttribute(“error”, “”);
go(“/index.jsp”, request, response);
}
}
//修改密码
if(ac.equals(“uppass”))
{
String olduserpass = request.getParameter(“olduserpass”);
String userpass = request.getParameter(“userpass”);
String copyuserpass = request.getParameter(“copyuserpass”);
user = dao.getmap(Info.getUser(request).get(“id”).toString(), “sysuser”);
if(!(((String)user.get(“upass”)).equals(olduserpass)))
{
request.setAttribute(“error”, “”);
go(“/admin/uppass.jsp”, request, response);
}else{
String id = (String)user.get(“id”);
String sql = “update sysuser set upass='”+userpass+“’ where id=”+id;
dao.commOper(sql);
request.setAttribute(“suc”, “”);
go(“/admin/uppass.jsp”, request, response);
}
}
if(ac.equals(“uploaddoc”))
{
try {
String filename=“”;
request.setCharacterEncoding(“utf-8”);
RequestContext requestContext = new ServletRequestContext(request);
if(FileUpload.isMultipartContent(requestContext)){
DiskFileItemFactory factory = new DiskFileItemFactory();
factory.setRepository(new File(request.getRealPath(“/upfile/”)+“/”));
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setSizeMax(10010241024);
List items = new ArrayList();
items = upload.parseRequest(request);
FileItem fileItem = (FileItem) items.get(0);
if(fileItem.getName()!=null && fileItem.getSize()!=0)
{
if(fileItem.getName()!=null && fileItem.getSize()!=0){
File fullFile = new File(fileItem.getName());
filename = Info.generalFileName(fullFile.getName());
File newFile = new File(request.getRealPath(“/upfile/”)+“/” + filename);
try {
fileItem.write(newFile);
} catch (Exception e) {
e.printStackTrace();
}
}else{
}
}
}
go(“/js/uploaddoc.jsp?docname=”+filename, request, response);
} catch (Exception e1) {
e1.printStackTrace();
}
}
public void init() throws ServletException {
// Put your code here
}
public static void main(String[] args) {
System.out.println(new CommDAO().select(“select * from mixinfo”));
}
public void go(String url,HttpServletRequest request, HttpServletResponse response)
{
try {
request.getRequestDispatcher(url).forward(request, response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void gor(String url,HttpServletRequest request, HttpServletResponse response)
{
try {
response.sendRedirect(url);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
主要数据库设计:
CREATE TABLE IF NOT EXISTS fav
(
id
int(11) NOT NULL AUTO_INCREMENT,
qzzuname
varchar(255) DEFAULT NULL,
zpinfoid
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS area
(
id
int(11) NOT NULL AUTO_INCREMENT,
addr
varchar(255) DEFAULT NULL,
delstatus
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS emp
(
id
int(11) NOT NULL AUTO_INCREMENT,
uname
varchar(255) DEFAULT NULL,
tname
varchar(255) DEFAULT NULL,
title
varchar(255) DEFAULT NULL,
savetime
varchar(255) DEFAULT NULL,
status
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS yqlj
(
id
int(11) NOT NULL AUTO_INCREMENT,
ljname
varchar(255) DEFAULT NULL,
ljurl
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS zdatadic
(
id
int(11) NOT NULL AUTO_INCREMENT,
datatype
varchar(255) DEFAULT NULL,
ptitle
varchar(255) DEFAULT NULL,
content
text DEFAULT NULL,
savetime
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS zpinfo
(
id
int(11) NOT NULL AUTO_INCREMENT,
title
varchar(255) DEFAULT NULL,
zprs
varchar(255) DEFAULT NULL,
gzdd
varchar(255) DEFAULT NULL,
xl
varchar(255) DEFAULT NULL,
jl
varchar(255) DEFAULT NULL,
infotype
varchar(255) DEFAULT NULL,
bei
varchar(255) DEFAULT NULL,
dy
varchar(255) DEFAULT NULL,
savetime
varchar(255) DEFAULT NULL,
qyuname
varchar(255) DEFAULT NULL,
qytname
varchar(255) DEFAULT NULL,
gznr
text DEFAULT NULL,
fl
text DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS hbnews
(
id
int(11) NOT NULL AUTO_INCREMENT,
title
varchar(255) DEFAULT NULL,
author
varchar(255) DEFAULT NULL,
filename
varchar(255) DEFAULT NULL,
content
text DEFAULT NULL,
savetime
varchar(255) DEFAULT NULL,
infotype
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS messages
(
id
int(11) NOT NULL AUTO_INCREMENT,
saver
varchar(255) DEFAULT NULL,
savetime
varchar(255) DEFAULT NULL,
content
varchar(255) DEFAULT NULL,
resaver
varchar(255) DEFAULT NULL,
recontent
varchar(255) DEFAULT NULL,
resavetime
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS msg
(
id
int(11) NOT NULL AUTO_INCREMENT,
content
text DEFAULT NULL,
qzzuname
varchar(255) DEFAULT NULL,
qyid
varchar(255) DEFAULT NULL,
savetime
varchar(255) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS sysuser
(
id
int(11) unsigned NOT NULL AUTO_INCREMENT,
uname
varchar(255) DEFAULT NULL,
upass
varchar(255) DEFAULT NULL,
tname
varchar(255) DEFAULT NULL,
filename
varchar(255) DEFAULT NULL,
sex
varchar(255) DEFAULT NULL,
qq
varchar(255) DEFAULT NULL,
email
varchar(255) DEFAULT NULL,
houhold
varchar(255) DEFAULT NULL,
addrs
varchar(255) DEFAULT NULL,
birth
varchar(255) DEFAULT NULL,
wei
varchar(255) DEFAULT NULL,
hei
varchar(255) DEFAULT NULL,
health
varchar(255) DEFAULT NULL,
tel
varchar(255) DEFAULT NULL,
总结
阿里伤透我心,疯狂复习刷题,终于喜提offer 哈哈~好啦,不闲扯了
1、JAVA面试核心知识整理(PDF):包含JVM,JAVA集合,JAVA多线程并发,JAVA基础,Spring原理,微服务,Netty与RPC,网络,日志,Zookeeper,Kafka,RabbitMQ,Hbase,MongoDB,Cassandra,设计模式,负载均衡,数据库,一致性哈希,JAVA算法,数据结构,加密算法,分布式缓存,Hadoop,Spark,Storm,YARN,机器学习,云计算共30个章节。
2、Redis学习笔记及学习思维脑图
3、数据面试必备20题+数据库性能优化的21个最佳实践
img-ihXT1BOB-1718915960741)]
1、JAVA面试核心知识整理(PDF):包含JVM,JAVA集合,JAVA多线程并发,JAVA基础,Spring原理,微服务,Netty与RPC,网络,日志,Zookeeper,Kafka,RabbitMQ,Hbase,MongoDB,Cassandra,设计模式,负载均衡,数据库,一致性哈希,JAVA算法,数据结构,加密算法,分布式缓存,Hadoop,Spark,Storm,YARN,机器学习,云计算共30个章节。
[外链图片转存中…(img-zBuWh2L1-1718915960742)]
2、Redis学习笔记及学习思维脑图
[外链图片转存中…(img-L4IZqlNJ-1718915960743)]
3、数据面试必备20题+数据库性能优化的21个最佳实践
[外链图片转存中…(img-lQUoOHfi-1718915960743)]