自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

记录代码生活

记录代码生活

  • 博客(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 381 1

原创 maven 包管理导入父类第三方jar包

<resources> <resource> <directory>../psp-dao/lib</directory> <targetPath>BOOT-INF/lib</targetPath> <includes> <include>**/*.jar&

2021-10-22 10:55:44 239

原创 Vue-编译打包:npm run build:prod

Vue-编译打包:npm run build:prod

2021-10-20 09:12:38 966

原创 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 88

原创 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 1235 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 45

原创 删除MySQL数据库中的所有的表

SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')FROM information_schema.tablesWHERE table_schema = 'pspdb01';

2021-06-30 11:48:18 72

原创 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 120

原创 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 47

原创 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 126

原创 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 397

原创 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 65

原创 spring boot 启动指定 配置文件

java -jar etx-1.0.0-RELEASE.jar --spring.profiles.active=dev

2021-06-02 23:27:54 166

原创 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 48

原创 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 68

原创 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 81

原创 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 55

原创 分页计算逻辑

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 136

原创 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 51

原创 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 104

原创 简易的文件下载功能

服务器端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 51

原创 线程池

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 27

原创 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 78

原创 线程等待同时执行方法

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 70

原创 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 56

原创 读写锁

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 38

原创 可重入锁实现方法有序执行

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 64

原创 生产者消费者模型

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 38

原创 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 57

原创 单例双重验证

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 100

原创 vagrant 创建虚拟机

软件下载 vagrant 可以我们用命令去创建虚拟机,不需要我们自己下载镜像。 vagrant下载地址: https://www.vagrantup.com/ ![在这里插入图片描述](https://img-blog.csdnimg.cn/2020090722440310.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4

2020-09-07 22:45:31 57

原创 java大数据插入数据库时间测试(消耗的时间跟硬件)

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 790

原创 spring boot + spring security + ajax 实现登录退出session管理

文章目录登录验证--> 权限管理-->session 设置Maven导入jar包数据库设计创建实体类Mapper文件(部分代码省去,只有sql语句)UserService 准备登录,权限验证配置session过期时间测试(ajax)登录验证–> 权限管理–>session 设置Maven导入jar包 <dependency> ...

2020-04-05 00:45:45 477

原创 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 101

原创 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 1011 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除