- 博客(22)
- 收藏
- 关注
原创 反射调用类的方法
StdItemStrategyAppService person = new StdItemStrategyAppService();Class<? extends StdItemStrategyAppService> aClass = person.getClass();StdItemStrategyAppService stdItemStrategyAppService = null;try { stdItemStrategyAppService = aClass.newIn.
2021-11-23 11:28:44 326
原创 使用framework做一个生成sql的功能
//1.创建配置类 Configuration configuration = new Configuration(Configuration.getVersion()); //2.设置模板所在的目录 configuration.setDirectoryForTemplateLoading(new File(System.getProperty("user.dir")+"/ime-framework-all/...
2020-10-15 17:48:25 136
原创 Nacos常规配置快速入门
启动nocas服务单机部署:1.git克隆项目git clone https://github.com/alibaba/nacos.git2.进入根目录cd nacos/3.maven编译mvn -Prelease-nacos clean install -U3.进入目录cd distribution/target/nacos-server-version/nacos/bin1注意{version}/nacos/bin1注意version/nacos/bin1注意{version} 根据
2020-08-12 15:30:02 848
转载 oracle数据库解锁
oracle数据库表锁住1、查看数据库锁,诊断锁的来源及类型:select object_id,session_id,locked_mode from v$locked_object;或者用以下命令:select b.owner,b.object_name,l.session_id,l.locked_mode from v$locked_object l, dba_objects b w...
2020-01-16 11:47:30 120
原创 如何写一个webservice 和消费webservice
@WebService(serviceName = "TestWsService", targetNamespace = "http://xxxxxx.com/", endpointInterface = "xxxxxxx")public class TestWsServiceImpl implements TestWsService { @Overri...
2019-12-11 10:20:27 161
原创 java8Stream的新特性
java8的特性的进阶之路eg1:codesList.forEach(codes->{List list = allocationExtRepository.findByCodeInAndBusiUnitGid(codes,busiUnitGid);if (!CollectionUtils.isEmpty(list)){allList.addAll(list);}});eg2...
2019-11-19 17:49:37 91
原创 通过公司服务器上面的URL下载文件到本地
之前遇到了一个大坑,URL里面有中文导致:new URL(你的url路径).openConnection();这段代码获取连接的时候(有中文就会报400);解决方式:把含有中文的那一段fileName(注意是fileName,就是url最后一截)----->String utfFileName = URLEncoder.encode(fileName, "utf-8");...
2019-11-19 17:24:52 320
转载 虚拟机查看防火墙
1:查看防火状态systemctl status firewalldservice iptablesstatus2:暂时关闭防火墙systemctl stop firewalldservice iptablesstop3:永久关闭防火墙systemctl disable firewalldchkconfig iptables off4:重启防火墙sy...
2019-11-06 18:50:46 12162 1
转载 比较好的abc轮流打印的线程控制的比较好的demo
主线程休眠,等待执行完再执行public class ABC_Synch {public static class ThreadPrinter implements Runnable {private String name;private Object prev;private Object self;private ThreadPrinter(String name, Object...
2019-07-23 14:58:42 115
转载 冒泡排序的demo
外层是需要比对的次数内层是比较的逻辑处理public static void main(String[] args) {int[] num={1,5,2,4,9};for (int i = 0; i <num.length-1 ; i++) {for (int j = 0; j <num.length-i-1 ; j++) {if (num[j]>num[j+1]) ...
2019-07-23 14:56:57 137
转载 快排例子
快速排序的一个小的demopublic class MainDemo {public static void main(String[] args) {Integer a[] = {3, 2, 1, 4, 5, 6, 7, 1};//递归调用QuickSort(a, 0, a.length-1);for (int i = 0; i <a.length ; i++) {Syste...
2019-07-23 14:55:13 498
原创 这个是批量插入数据的demo
把数据条数有序的做排列(注意不能有并列的条件,会导致数据随机性),然后根据数据的复杂程度定义3000或者30000的分批次的插入。分多线程进行插入!public void addLawyerPortraitOrgSic() { HashMap<String, Object> map = new HashMap<String, Object>(); long...
2019-07-23 14:31:28 457
原创 导出word或者excel文件,请求的书写的方式
下载word://把文件下载成字节数组byteProductWord = productService.productMomGoodsWord(productId,request);String fileName = URLEncoder.encode((productName==null?"无产品名称":productName)+".docx", StandardChars...
2019-07-23 14:27:46 373
转载 如何按顺序轮流打印abc
public class ABC_Synch { public static class ThreadPrinter implements Runnable { private String name; private Object prev; private Object self; private ThreadPrint...
2019-07-23 14:03:56 999
转载 如何合并多个word 里面的内容
public void wordMix(String src1Input,String src2Input,String src3Input) throws Exception { InputStream in1 = null; InputStream in2 = null; OPCPackage src1Package = n...
2019-07-23 11:51:38 214
转载 HashMap的储存过程?
HashMap的工作原理是近年来常见的Java面试题。几乎每个Java程序员都知道HashMap,都知道哪里要用HashMap,知道HashTable和HashMap之间的区别,那么为何这道面试题如此特殊呢?是因为这道题考察的深度很深。这题经常出现在高级或中高级面试中。投资银行更喜欢问这个问题,甚至会要求你实现HashMap来考察你的编程能力。ConcurrentHashMap和其它同步集合的引入...
2018-05-17 23:03:55 2745
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人