会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
我没有出家
博客园
首页
新随笔
联系
管理
订阅
随笔分类 -
java
1
2
下一页
poi 两个excel对比,输出到新的excel
摘要:List<String> ips1 = new ArrayList<>(); List<String> ips2 = new ArrayList<>(); File file1 = new File("C:\\Users\\Administrator\\Desktop\\20241224.xlsx"
阅读全文
posted @
2025-01-14 10:52
我没有出家
阅读(13)
评论(0)
推荐(0)
将字段转驼峰,获取对象中的属性值
摘要:// 获取对象中属性的值 public String getFieldValue(String attrName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { // 转驼峰 Str
阅读全文
posted @
2024-03-21 15:37
我没有出家
阅读(35)
评论(0)
推荐(0)
java 策略模式解决if-else ,函数式接口解决编写多个子类的问题
摘要:/** * @author: szc * @date: 2023/9/2 22:45 * @version: 1.0 * @description: 从map中获取函数式接口,解决if-else 多个子类问题 */ @Service public class MapToInterface { @Au
阅读全文
posted @
2023-12-10 20:09
我没有出家
阅读(34)
评论(0)
推荐(0)
获取过去某个时间到现在相差的时间天时分
摘要:private String getTimeOutStr(long nowDate, long lastTime) { String str =""; long minute = 1000 * 60 ; long hour = 1000 * 60 * 60 ; long day = 1000 * 6
阅读全文
posted @
2023-11-10 16:51
我没有出家
阅读(24)
评论(0)
推荐(0)
double 四舍五入和去尾
摘要:// import java.math.RoundingMode;// import java.text.NumberFormat; double d= 1.345233; //四舍五入 保留两位小数 System.out.println(String.format("%.2f",d)); //不四
阅读全文
posted @
2022-03-30 22:00
我没有出家
阅读(88)
评论(0)
推荐(0)
java 操作PDF (spire.pdf)api
摘要:https://www.e-iceblue.cn/pdf_java_image_shapes/replace-image-with-new-image-in-pdf-in-java.html maven依赖 <repositories> <repository> <id>com.e-iceblue<
阅读全文
posted @
2021-06-01 17:29
我没有出家
阅读(1129)
评论(0)
推荐(0)
获得mysql数据库信息 (字段名、字段类型、字段注释)工具类
摘要:public class DbInfoUtil { /** * 根据数据库的连接参数,获取指定表的基本信息:字段名、字段类型、字段注释 * @param driver 数据库连接驱动 * @param url 数据库连接url * @param user 数据库登陆用户名 * @param pwd
阅读全文
posted @
2021-05-20 10:44
我没有出家
阅读(464)
评论(0)
推荐(0)
redis操作工具类
摘要:package com.szc.demo.redis_demo.utils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.Redis
阅读全文
posted @
2021-05-18 18:55
我没有出家
阅读(144)
评论(0)
推荐(0)
java爬取https上的图片
摘要:/** * @author szc * @date 2021/4/21 - 16:42 */ public class test4 { public static void main(String[] args) throws IOException { String strUrl = "https
阅读全文
posted @
2021-04-21 16:52
我没有出家
阅读(966)
评论(0)
推荐(0)
java实现https爬取
摘要:来自: https://blog.csdn.net/Sakuraaaaaaa/article/details/107280162 HttpsUtil 工具类 import org.apache.http.config.Registry; import org.apache.http.config.R
阅读全文
posted @
2021-04-21 09:56
我没有出家
阅读(576)
评论(0)
推荐(0)
遍历文件夹创表入库csv文件,直接使用
摘要:import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.Hanyu
阅读全文
posted @
2021-03-31 13:08
我没有出家
阅读(99)
评论(0)
推荐(0)
判断文件字符集
摘要:<!-- 判断文件编码格式 --> <dependency> <groupId>org.apache.any23</groupId> <artifactId>apache-any23-encoding</artifactId> <version>1.1</version> </dependency>
阅读全文
posted @
2021-03-31 10:06
我没有出家
阅读(159)
评论(0)
推荐(0)
遍历文件夹批量创建数据库表,表字段转成拼音
摘要:import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.Hanyu
阅读全文
posted @
2021-03-30 15:48
我没有出家
阅读(54)
评论(0)
推荐(0)
自定义异常类
摘要:https://www.cnblogs.com/menmenz/p/11649613.html
阅读全文
posted @
2021-02-01 14:32
我没有出家
阅读(33)
评论(0)
推荐(0)
zip 通过 response 下载 (多级文件夹压缩)
摘要:@ResponseBody @RequestMapping("/szctest2") public void zip(HttpServletResponse response) throws Exception { String sourceFileName = "D:\\test"; //要压缩的
阅读全文
posted @
2021-01-28 16:54
我没有出家
阅读(1660)
评论(1)
推荐(1)
zip 通过response 下载,不足 多级目录目录的文件只会压缩到一个文件夹中
摘要:@ResponseBody @RequestMapping("/szctest1") public void zip1(HttpServletResponse response,HttpServletRequest request) throws IOException { String path
阅读全文
posted @
2021-01-28 16:34
我没有出家
阅读(236)
评论(0)
推荐(0)
zip 文件导出 main(多级目录压缩)
摘要:package com.ruoyi.web.controller.test; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.Fi
阅读全文
posted @
2021-01-28 16:32
我没有出家
阅读(316)
评论(0)
推荐(0)
poi xls文件导出,分多个sheet
摘要:package test; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.ap
阅读全文
posted @
2021-01-28 10:36
我没有出家
阅读(308)
评论(0)
推荐(0)
向txt中简单写
摘要:File file1 = new File("e://异常.txt"); BufferedWriter out = new BufferedWriter(new FileWriter(file1,true)); out.write(file2.getAbsolutePath()); out.newL
阅读全文
posted @
2021-01-26 17:50
我没有出家
阅读(51)
评论(0)
推荐(0)
遍历获得文件夹下的所有文件
摘要:public void traverseFolder2(String path) { File file = new File(path); if (file.exists()) { File[] files = file.listFiles(); if (null == files || file
阅读全文
posted @
2021-01-26 17:41
我没有出家
阅读(104)
评论(0)
推荐(0)
1
2
下一页
公告