- 博客(4)
- 收藏
- 关注
转载 HashMap多线程下发生死循环原因及解决
可能发生的原因:1、多线程put操作后,get操作导致死循环。2、多线程put非null元素后,get操作得到null值。解决:1、使用ConcurrentHashMap代替HashMap。2、使用Collections.synchronizedMap(Mao<K,V> m)方法把HashMap变成一个线程安全的Map。...
2019-05-28 17:32:49
627
原创 Mybatis之查询一张表中一个字段的上下2条数据
selectcontent, country_id,(select title from information WHERE #{id} > id and (status = 1) ORDER BY id DESC limit 1) AS last_title,(select title from information WHERE id > #{id} and (status ...
2018-12-21 19:59:31
881
原创 Mybatis之查出一张表中一个字段2种不同类型的数据
查出一张表中一个字段2种不同类型的数据selectid, title, content, picture, timestamp, type, status, country_idfrom (select * from information order by TIMESTAMP DESC) AS bwhere status=1 and country_id=#{countryId, jdb...
2018-12-19 20:01:15
967
1
原创 Java菜鸟日常问题总结
使用idea打war包报错收集打包报错:打包时无法生成war,并且compile报错:解决:)打包报错:打包时无法生成war,并且compile报错:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project...
2018-12-19 19:56:32
247
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人