2020年11月26日

java map排序

摘要: public void statisticsA(){ List<Moves> file = this.file(); Map<String,Integer> map = new HashMap<>(); int init=1; for (Moves moves1 : file) { if("".eq 阅读全文

posted @ 2020-11-26 20:04 Difcipo 阅读(74) 评论(0) 推荐(0) 编辑

2020年11月25日

文件上传

摘要: 1. 导入jar包,这里还要导入servlet api 2. 编写servlet @WebServlet("/upFile") public class UpLoad extends HttpServlet { // 上传文件存储目录 private static final String UPLO 阅读全文

posted @ 2020-11-25 23:18 Difcipo 阅读(98) 评论(0) 推荐(0) 编辑

文件下载

摘要: public class DownLoadServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletExce 阅读全文

posted @ 2020-11-25 21:40 Difcipo 阅读(66) 评论(0) 推荐(0) 编辑

2020年11月23日

Filter过滤器

摘要: 1.过滤器要实现Filter接口 import javax.servlet.* public class EncodingFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws S 阅读全文

posted @ 2020-11-23 22:12 Difcipo 阅读(78) 评论(0) 推荐(0) 编辑

java编写一个简单的验证码

摘要: public class ImageServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletExcepti 阅读全文

posted @ 2020-11-23 21:03 Difcipo 阅读(104) 评论(0) 推荐(0) 编辑

centos7安装mysql

摘要: 1. 先下载mysql 地址: mysql5.7-rpm.tar 2. 可以用Xshell中的Xftp把下载后的文件上传到centos上,然后解压: tar -xvf mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql5.7 解压 阅读全文

posted @ 2020-11-23 15:37 Difcipo 阅读(111) 评论(0) 推荐(0) 编辑

linux安装jdk,tomcat服务器

摘要: 这里用Centos7为例。 1. 下载好jdk和tomcat, 2. 解压文件 tar -xzvf 压缩的文件名 -C 目标路径 3. 解压后把文件移动到/usr/local/目录下。注意这里路径是tomcat和jdk原解压的地方。 mv apache-tomcat-8.0.53 /usr/loca 阅读全文

posted @ 2020-11-23 14:08 Difcipo 阅读(80) 评论(0) 推荐(0) 编辑

2020年11月21日

DBUtil工具类

摘要: 1. 添加jar包 2. 获取数据源对象; DataSource ds = DataSourceUtil.getDataSource();//自己写的工具类 3. 获取QueryRunner对象 QueryRunner qr = new QueryRunner(ds); 修改:runner.upda 阅读全文

posted @ 2020-11-21 21:30 Difcipo 阅读(93) 评论(0) 推荐(0) 编辑

mysql

摘要: 1.常用数据类型 int,char,varchar,double,float,text 2. group by和order by 分组后的字段要么是分组字段或聚合函数 where和having区别: where:在分组之前进行限定;后面不能跟聚合函数的判断 having:在分组之后进行限定,如果不满 阅读全文

posted @ 2020-11-21 19:33 Difcipo 阅读(82) 评论(0) 推荐(0) 编辑

mysql聚合函数

摘要: 1.count() ;计算个数 聚合函数计算和会排出null select count(english) from user; 聚合函数会排出null. 解决办法: 1. select count(ifnull(english,0)) from user; 2. 选择不包含空的列计算(一般会选择主键 阅读全文

posted @ 2020-11-21 19:20 Difcipo 阅读(76) 评论(0) 推荐(0) 编辑

导航