上一页 1 2 3 4 5 6 ··· 168 下一页
摘要: 停止一个线程通常意味着在线程处理任务完成之前停掉正在做的操作,也就是放弃当前的操作。 在 Java 中有以下 3 种方法可以终止正在运行的线程: 使用退出标志,使线程正常退出,也就是当 run() 方法完成后线程中止。 使用 stop() 方法强行终止线程,但是不推荐使用这个方法,该方法已被弃用。 阅读全文
posted @ 2020-08-13 15:02 无天666 阅读(1289) 评论(0) 推荐(0) 编辑
摘要: public class InterruptThread2 extends Thread{ public static void main(String[] args) { try { InterruptThread2 t = new InterruptThread2(); t.start(); T 阅读全文
posted @ 2020-08-13 15:00 无天666 阅读(424) 评论(0) 推荐(0) 编辑
摘要: public class TimerTest { public static void main(String[] args) { final Timer1 timer = new Timer1("定时器线程"); Ticket ticket = new Ticket(timer); Thread 阅读全文
posted @ 2020-08-04 10:14 无天666 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-03-27 10:54 无天666 阅读(1030) 评论(0) 推荐(1) 编辑
摘要: 主要用到的是ReentrantLock锁,还有 notEmpty empty两个条件,生产连接与消费连接的线程在两个条件上等待与唤醒。empty还是生产者,notEmpty是消费者。主要DruidAbstractDataSource与DruidDataSource两个类了。 创建连接 DruidDa 阅读全文
posted @ 2020-02-27 18:07 无天666 阅读(607) 评论(0) 推荐(1) 编辑
摘要: 接口调用: http://localhost:8080/testBoot/getUser/25: public String GetUser(@PathVariable int id){ return userMapper.Sel(id).toString(); //userMapper = org 阅读全文
posted @ 2020-02-23 15:38 无天666 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 与spring集成,入口: SqlSessionFactoryBean实现InitializingBean接口,InitializingBean接口有afterPropertiesSet()方法,(spring的getBean方法里面调进去的) SpringApplication.run(Mybat 阅读全文
posted @ 2020-02-23 15:12 无天666 阅读(315) 评论(0) 推荐(0) 编辑
摘要: Class.forName("com.mysql.jdbc.Driver"); public class Driver extends NonRegisteringDriver implements java.sql.Driver { static { try { java.sql.DriverMa 阅读全文
posted @ 2020-02-07 15:36 无天666 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 通过MYSQLIO执行IO操作。 commit=true/false,代码执行是一样的,都flush出去了,只是服务器端没有执行。 package com.zhuguang.jack.jdbc; import java.sql.*; public class JDBCTransationTest { 阅读全文
posted @ 2020-02-04 16:42 无天666 阅读(1723) 评论(0) 推荐(0) 编辑
摘要: getBeanPostProcessors()就是所有的后置处理器,就是拦截器,就是责任链模式。spring和mybatis的桥梁在于 MybatisAutoConfiguration,MapperFactoryBean ## 数据源配置 spring.datasource.url=jdbc:mys 阅读全文
posted @ 2019-11-29 10:54 无天666 阅读(367) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 168 下一页