自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Wi

出现这个错误的原因是Windows上没有hadoop.dll文件 具体参考:https://blog.youkuaiyun.com/a2099948768/article/details/79577246

2019-08-26 14:02:46 385

原创 SpringBoot上传文件至项目路径下

package com.lianxi.demo85.controller; import com.lianxi.demo85.Utils.UploadUtils; import io.swagger.annotations.Api; import org.springframework.stereotype.Controller; import org.springframework.web.bi...

2019-08-20 14:06:16 7135

原创 Sql进行删除可以使用别名

Jpa利用原生sql进行删除操作的时候是可以使用别名的: 使用别名的语句; @Modifying @Transactional(rollbackFor = Exception.class) @Query(value = “delete g from good g where g.id IN (:ids)”,nativeQuery = true) int deleteBatch(@Param(“id...

2019-04-22 16:48:03 548

原创 Spring Boot上传图片或文件并且进行访问(至指定盘符)

Controller层: @Controller public class FileController(){ //访问相应的页面 @GetMapping(value = “file”) public String file(){ return “file”; } @PostMapping(value = “/uploadfile”) public String fileUpload(@Reque...

2019-04-16 09:41:40 3358 1

翻译 java中重写与重载的区别

重写与重载的区别: 方法的重载是同一个类中的多个方法具有相同的名称,但这些方法具有不同的参数列表,即参数的数量与参数的类型不能完全相同; 方法的重写是存在于子类与父类之间的,子类与父类的方法具有相同的的方法名称,相同的参数列表与相同的返回类型 注: (1).子类中不能重写父类的final方法 (2).子类中必须重写父类的abstract方法 重载(overloading): (1).方法的重载是让...

2019-03-25 14:29:05 334

原创 Pattern与Matcher的具体用法

这是正则表达式Pattern.compile(“a*b”);这个是规范; Matcher m = p.matcher(“aabbcc”);这个是被测试的内容 //判断是否是数字 Pattern p = Pattern.compile("\d+"); //需要判断的字符串 Matcher m = p.matcher(“12345646”); if(m.matchers()){ System.out....

2019-03-22 15:56:12 466

原创 String.join()方法的使用

String results = String.join("-",“join”,“c++”,“ruby”); 输出的结果为:join-c+±ruby 也可以使用如下方法: String [ ] arr = {“java”,“c++”,“ruby”}; String result = String.join("",arr); 输出结果为:joinc++*ruby 参数列表: 1.表示连接的符号; 2...

2019-03-21 17:03:47 1154

原创 java8 stream filter等功能替代for循环

对象A public class A{ private Long id; private Stirng name; … 省略get(),set()方法 } 在List中,查找name为“weixiaoman”的对象A 1.在java8中可以这样写:这样返回的是对象; Optional firstA = AList.stream().filter(oi -> “weixioaman”.equ...

2019-03-21 16:10:29 1380

原创 Jpa实现动态分页查询

Repository层 public interface UserRepository extends JpaSpecificationExecutor,JpaRepository<User,Long>{ } Util包 public class UserUtil { /** * 判断字符串是否为空 * @param str * @return true-不为空 false-为...

2019-02-12 15:59:34 1372

原创 sql聚合函数可以用来统计,求和,求最值

count:统计行数量 sum:统计单个列的合计值 avg:统计某个列的平均值 max:统计某人列的最大值 min:统计某个列的最小值

2019-02-02 14:38:22 1971

原创 Spring JPA-Hibernate报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an er

Hibernate: alter table emp.customer add column desc varchar(255) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that ...

2019-01-25 10:32:47 583

原创 枚举类型的应用

枚举类型:可以将相关的常量分组到一个枚举类型里面 public enum Color{ RED(“红色”,1), GREEN(“绿色”,2), YELLOW(“黄色”,3), BLANK(“白色”,4); //成员变量 private Stirng name; private int index; //构造方法 public Color(String name,int index){ this...

2019-01-16 10:35:43 602

原创 BigDecimal的运算

BigDecimal num1 = new BigDecimal(3.0); BigDecimal num2 = new BigDecimal(2.1); BigDecimal num3 = null; num3 = num1.add(num2); System.out.println(“和是”+num3); num3 = num1.multiply(num2); System.out.print...

2019-01-15 15:56:19 238

原创 html+js点击按钮在当前页面显示一个窗口

用户信息 window.open 弹出新窗口的命令;   'page.html' 弹出窗口的文件名;   'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;   height=100 窗口高度;   width=400 窗口宽度;   top=0 窗口距离屏幕上方的象素值;   left=0 窗口距离屏幕左侧的象素值;  ...

2019-01-11 11:07:16 13384 3

原创 jpa+springboot实现某年天数的遍历

jpa+spring boot实现某年的天数 Entity层 @Entity @Table(name=“date”) @ApiModel(value=“date”,description = “日期记录对象”) public class Month { @Id @GeneratedValue(strategy = GenerationType.AUTO) @ApiModelProperty(val...

2019-01-10 17:32:48 341

原创 spring boot+jpa 实现登录注册功能

spring boot+jpa实现登录注册功能 Controller层 IndexController public class IndexController { private User user = new User(); @RequestMapping("/register") public String register(){ return "register"; } @Re...

2019-01-10 17:07:33 8533 4

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除