java
一直梦见飞的路人涛
github地址:https://github.com/ljt960202
展开
-
If_else解决
if else 旧代码 public BigDecimal calPrice(BigDecimal orderPrice, String buyerType) { if (用户是专属会员) { if (订单金额大于30元) { returen 7折价格; } } if (用户是超级会员) { ret...原创 2020-02-27 11:26:16 · 246 阅读 · 0 评论 -
日期工具类
日期工具类 日期工具类:DateTools.java package com.leejt; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar;...原创 2020-02-25 09:35:50 · 137 阅读 · 0 评论 -
Eclipse远程调试java
添加新用户,并赋予root权限 adduser work passwd work 上次tomcat软件,上传程序war包 将80端口的请求转发到8080端口(永久生效) systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 yum install ipta...原创 2019-11-04 10:40:32 · 153 阅读 · 0 评论 -
java按字节截取字符串
需求:oracle有个备注长度只有100,但是不能扩大,只能截取java传输过程中的字符长度 如何知道一个汉字在Oracle数据库中具体占用几个字节? 方式一:这个其实和Oracle的配置是相关的,用以下语句查询当前数据库的字符集: 理论 select * from v$nls_parameters t where t.PARAMETER='NLS_CHARACTERSET'; 可以得到如...原创 2019-08-21 14:58:11 · 462 阅读 · 0 评论 -
pinyin4j API 将汉字转换为拼音(java)
需求 有个excel文档需要把中文名变为拼音,二个字的为全拼,二个字以上的第一个全拼后面首字母,都是小写 实现代码 package com.zjnac.restfulapi; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; imp...原创 2019-09-06 09:17:21 · 467 阅读 · 0 评论