上一页 1 2 3 4 5 6 ··· 167 下一页
摘要: 停止一个线程通常意味着在线程处理任务完成之前停掉正在做的操作,也就是放弃当前的操作。 在 Java 中有以下 3 种方法可以终止正在运行的线程: 使用退出标志,使线程正常退出,也就是当 run() 方法完成后线程中止。 使用 stop() 方法强行终止线程,但是不推荐使用这个方法,该方法已被弃用。 阅读全文
posted @ 2020-08-13 15:02 无天666 阅读(1329) 评论(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 阅读(440) 评论(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 阅读(570) 评论(0) 推荐(0)
摘要: 接口调用: 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 阅读(534) 评论(0) 推荐(0)
摘要: 与spring集成,入口: SqlSessionFactoryBean实现InitializingBean接口,InitializingBean接口有afterPropertiesSet()方法,(spring的getBean方法里面调进去的) SpringApplication.run(Mybat 阅读全文
posted @ 2020-02-23 15:12 无天666 阅读(324) 评论(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 阅读(273) 评论(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 阅读(1817) 评论(0) 推荐(0)
摘要: getBeanPostProcessors()就是所有的后置处理器,就是拦截器,就是责任链模式。spring和mybatis的桥梁在于 MybatisAutoConfiguration,MapperFactoryBean ## 数据源配置 spring.datasource.url=jdbc:mys 阅读全文
posted @ 2019-11-29 10:54 无天666 阅读(375) 评论(0) 推荐(0)
摘要: public class BootStrap { public static void start(){ MySqlSession sqlSession = new MySqlSession();//外层使用sqlSession,生成Mapper的代理, //TestMapper是一个接口,所以是一个动态代理, TestMapper testMapper = sqlSession.getMappe 阅读全文
posted @ 2019-11-27 20:15 无天666 阅读(257) 评论(0) 推荐(0)
摘要: 基于JDBC的。 阅读全文
posted @ 2019-11-27 20:10 无天666 阅读(282) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 167 下一页