- 博客(35)
- 收藏
- 关注
原创 mysql 交集计算
mysql 交集计算数据的交集运算mysql并没有提供直接的语法,所以我们必须用其它的方式去求解。not in not exists 符合我们的要求。但是 not in not exists 存在效率问题根据表大小选择。还有一种方式使用 left join 方式。SELECT * FROM student WHERE s_id NOT IN (SELECT s_id FROM score WHERE c_id IN ( SELECT b.c_id FROM
2021-10-25 10:54:27
433
1
原创 maven 包管理导入父类第三方jar包
<resources> <resource> <directory>../psp-dao/lib</directory> <targetPath>BOOT-INF/lib</targetPath> <includes> <include>**/*.jar&
2021-10-22 10:55:44
280
原创 mysql 常用命令
创建用户-- 创建用户kl并且只能在172.118.80.32上登陆密码为 *****create user 'kl'@'172.18.80.32' identified by '*****';注意:在mysql.user 中添加数据,不同的版本password 存储的地方不一样 老版本存储在 password 字段中,新版本存储在auth_string 中授权用户-- 创建用户并且授权test数据库的权限,如果原有的账户已经存在密码则覆盖grant all privileges on tes
2021-10-14 11:26:44
110
原创 VUE 表格设置序号
这里写自定义目录标题vue表格方法vue表格 <el-table-column type="index" label="序号" width="55" :index="indexMethod" align="center"/>方法 indexMethod(index) { index = (index + 1) + (this.queryParams.pageNum - 1) * this.queryParams.pageSize return
2021-10-13 11:29:30
1291
1
原创 linux 之间配置 ssh 免密登陆
m s1 s2 三台机器上分别执行ssh-keygen -t rsam 想免密登陆 s1 在m上执行ssh-copy-id s1敲击回车,输入密码即可验证在 m 上 执行 ssh s1
2021-09-01 22:33:01
68
原创 删除MySQL数据库中的所有的表
SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')FROM information_schema.tablesWHERE table_schema = 'pspdb01';
2021-06-30 11:48:18
102
原创 yum更换
1.删除原有的自带的yumrpm -qa|grep yumrpm -qa|grep yum|xargs rpm -e --nodeps2.下载yum源https://vault.centos.org/7.2.1511/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpmyum-3.4.3-132.el7.centos.0.1.noarch.rpmyum-metadata-parser-1.1.4-10.el7.x86_64.rpmyu
2021-06-29 21:37:53
162
原创 mysql主从备份
先搞几个常用的命令select * from mysql.user -- 查看可远程登录的用户GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxxx' ; -- 远程可登录的用户 flush privileges; service mysqld restart -- linux 命令重启mysql 服务配置主库[mysqld]#idserver-id=1 – 这个是重点 其它参数根据实际情况配置就可以log-bin
2021-06-11 00:02:33
75
原创 reahat 下安装mysql 5.7.19
1.下载安装包https://downloads.mysql.com/archives/community/2.上传至服务器并解压3.使用rpm -Uvh 命令安装 rpm -Uvh mysql-community-devel-5.7.19-1.el7.x86_64.rpm这里安装是有顺序的,但是可以根据提示判断出来,可以使用 rpm -qa|grep mysql 命令去查看安装过的依赖4.安装后重启mysql service mysqld start5.修改MySQL配置文件:vim /etc
2021-06-10 22:05:20
166
原创 mysql sql语句查询时间统计方法
show status;show engines; -- 查看mysql 引擎show variables like 'key_buffer_size'; -- 查看关键字缓冲区show status like '%key_read%'create table course(cid int(3) ,cname varchar(20),tid int(3));create table teacher(tid int(3),tname varchar(20) ,tcid int(3
2021-06-09 23:13:19
434
原创 httpClient 发送 get psot请求
1.导入maven依赖(版本号自选)<dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> </dependency>2.程序代码 void doGet() throws IOException, URISyntaxExcepti
2021-06-03 22:56:41
87
原创 spring boot 启动指定 配置文件
java -jar etx-1.0.0-RELEASE.jar --spring.profiles.active=dev
2021-06-02 23:27:54
209
原创 netty 实现群聊
public class MyNettyServerTest { public static void main(String[] args) { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workGroup = new NioEventLoopGroup(); try{ ServerBootstrap serverBootstrap =
2021-05-30 19:51:05
69
原创 netty 网站搭建
public class MyNettyServerTest { public static void main(String[] args) { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workGroup = new NioEventLoopGroup(); try{ ServerBootstrap serverBootstrap =
2021-05-30 18:22:07
99
原创 nio 实现聊天服务
public class ChatServerCopy { static Map<String, SocketChannel> clientMap = new HashMap<>(); public static void main(String[] args) throws IOException { int[] ports = {7777,8888,9999}; Selector selector = Selector.open
2021-05-27 22:12:48
104
原创 oracle + mybatis 批量插入核心代码
<insert id="insertBatch" parameterType="java.util.List"> BEGIN <foreach collection="list" item="item" index="index" separator=""> insert into a_country (serial_no, country_code, chn_na...
2021-05-26 15:03:37
79
原创 分页计算逻辑
int size = list.size(); int count = 0 ; if(size%pageSize == 0){ count = size/pageSize ; }else{ count = size/pageSize + 1 ; } countDownLatch = new CountDownLatch(cou
2021-05-26 14:58:43
166
原创 nio内存映射方式复制文件
public class NioFileCopyOutJVM { public static void main(String[] args) throws IOException { long l1 = System.currentTimeMillis() ; FileChannel input = FileChannel.open(Paths.get("H:/e-touch-etx.zip"), StandardOpenOption.READ);
2021-05-26 00:05:57
72
原创 nio 使用channel 复制文件
public class ChannelTest { public static void main(String[] args) throws IOException { FileInputStream inputStream = new FileInputStream("H:/e-touch-etx.zip"); FileChannel inputStreamChannel = inputStream.getChannel(); FileOutp
2021-05-25 23:34:05
133
原创 简易的文件下载功能
服务器端public class ServiceSocket { public static void main(String[] args) { try { ServerSocket serverSocket = new ServerSocket(8899); while(true){ System.out.println("服务器启动..."); Socket so
2021-05-25 22:12:36
64
原创 线程池
public class ThreadPoolTest { public static void main(String[] args) { ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 2, 10, TimeUnit.MINUTES, new ArrayBlockingQueue<>(3),new ThreadPoolExecutor.AbortPoli
2021-05-23 22:00:13
39
原创 futureTask 使用
public class FutureTaskTest { public static void main(String[] args) { List<FutureTask<Integer>> list = new ArrayList<>(); ExecutorService executorService = Executors.newFixedThreadPool(5); for (int i = 0;
2021-05-21 00:12:08
124
原创 线程等待同时执行方法
public class CyclicNBarrier { public static void main(String[] args) { CyclicBarrier cyclicBarrier = new CyclicBarrier(3); MyThread2 myThread2 = new MyThread2(cyclicBarrier); for (int i = 0; i < 3 ; i++) { new Thr
2021-05-20 23:25:33
96
原创 countdownlacth 多线程闭锁
public class CountDownLatchTest { public static void main(String[] args) { CountDownLatch latch = new CountDownLatch(10); MyThread myThread = new MyThread(latch); for (int i = 0; i < 10; i++) { new Thread(myThre
2021-05-20 23:18:16
90
原创 读写锁
public class ReadWriteLockTest { ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); public void read(){ readWriteLock.readLock().lock(); try{ for (int i = 0; i < 1000 ; i++) { System.out.pri
2021-05-20 22:15:34
61
原创 可重入锁实现方法有序执行
public class reentrant01 { int num = 1 ; private Lock lock = new ReentrantLock(); private Condition condition1 = lock.newCondition(); private Condition condition2 = lock.newCondition(); private Condition condition3 = lock.newCondition()
2021-05-18 23:19:38
84
原创 生产者消费者模型
public class CarStock { private int cars ; public synchronized void productCar(){ while (cars > 20){ try { System.out.println(Thread.currentThread().getName()+" 生产者...挂起"); wait();
2021-05-18 21:10:40
51
原创 volatitle 不具有原子性代码
public class TestVolatitle_1 { public volatile static int j; public int add (){ synchronized (TestVolatitle_1.class){ return j++; } } public static void main(String[] args) throws InterruptedException {
2021-05-18 00:11:27
72
原创 单例双重验证
public class Singleton { public static volatile Singleton singleton = null ; private Singleton(){} public static Singleton getInstance(){ if (singleton == null) { synchronized (Singleton.class) { if (singlet
2021-05-17 23:15:13
120
原创 vagrant 创建虚拟机
软件下载 vagrant 可以我们用命令去创建虚拟机,不需要我们自己下载镜像。 vagrant下载地址: https://www.vagrantup.com/ 
1.直接循环插入100万条数据 pstmt = getConn().prepareStatement("insert into bigdata values (?,?,?)"); long bTime = System.currentTimeMillis(); for (int i = 0; i < 1000000; i++) { pstmt.setString(1,"id"+i); pstmt.setSt
2020-08-18 02:28:02
870
原创 spring boot + spring security + ajax 实现登录退出session管理
文章目录登录验证--> 权限管理-->session 设置Maven导入jar包数据库设计创建实体类Mapper文件(部分代码省去,只有sql语句)UserService 准备登录,权限验证配置session过期时间测试(ajax)登录验证–> 权限管理–>session 设置Maven导入jar包 <dependency> ...
2020-04-05 00:45:45
521
原创 Maven 安装第三方jar包
Maven 安装第三方jar包1.将jar包保存到本地。2.执行以下命令。mvn install:install-file -Dfile=H:\hbase-example.jar -DgroupId=hbase-example -DartifactId=hbase -Dversion=1.0.1 -Dpackaging=jar3.安装完成。4.找到安装jar包的路径查看配置文件。...
2020-03-19 23:23:11
129
原创 java IP地址网段计算
根据IP地址与字段掩码计算网段最大最小IPpackage c04;import java.net.UnknownHostException;public class IPNetworkSegmentCalculation { public static void main(String[] args) throws UnknownHostException { S...
2020-03-07 16:03:16
1054
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人