MyBatis uses reverse engineering to automatically generate the entity layer and dao layer of the project

1, Foreword I wrote an article about MyBatis Click the link to enter the basic CRUD of low version comparison However, it is not necessary to write dao layer and entity layer code in actual development, mainly using the shelf package provided by MyBatis Here is the whole process of using reverse engineering 2, Demo and code ① Create a ja ...

Posted on Fri, 01 May 2020 00:14:19 -0700 by geetakhurana

mysql mrr and an optimizer

When testing mrr, we encountered an interesting problem | bai_test | CREATE TABLE `bai_test` ( `id` int(11) NOT NULL AUTO_INCREMENT, `num` int(11) DEFAULT NULL, `name` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=11756 DEFAULT CHARSET=utf8 | mysql> explain select * from bai_ ...

Posted on Thu, 30 Apr 2020 21:52:35 -0700 by theoph

Database access of Spring Boot

1, Background Spring boot is a service development framework that integrates service publishing, database management and log management. It is also an all-around helper for microservice development. This chapter describes how to use spring boot to access MySQL database. 2, Build basic environment 1. Install Maven (a lot of guidance docume ...

Posted on Thu, 30 Apr 2020 20:09:29 -0700 by johnh

Some suggestions on writing high quality SQL

1. Try not to use select * to query SQL, but select specific fields. Counter example: select * from employee; Positive example: selectid,namefrom employee; reason: Only take the required fields, save resources and reduce network overhead. When select * is used for query, it is likely that the overwrite index will not be used, r ...

Posted on Thu, 30 Apr 2020 19:55:20 -0700 by adi

[java operation mysql] java connects mysql database and queries data

It's inevitable to deal with the database in java development, so here's an article about connecting mysql with jdbc, The main contents include: 1. java connect mysql 2. java queries mysql data. 3. java inserts mysql data. 4. java updates mysql data. 5. java deletes mysql data. 6. java executes mysql stored procedures. ide: IntelliJ IDEA201 ...

Posted on Thu, 30 Apr 2020 19:11:38 -0700 by Gugel

Simple application examples of Pop (specifically used in adding, deleting, modifying and querying components) and supplementary knowledge points

1, Let's start with self executing functions 1. What is the immediate execution function? That is, anonymous functions The immediate execution function is Declare an anonymous function Call this anonymous function now 2. An example of pop Click to open a new window. After saving, the page will return without refreshing the data. (click the + ...

Posted on Thu, 30 Apr 2020 15:47:05 -0700 by cybersurfur

Sample PreparedStatement usage code in JDBC

In order to prevent the user from using sql statements to inject and attack the database, the sub interface of the Statement interface can be used java.sql.PreparedStatement extends Statement This interface represents the object of the precompiled SQL statement, which is precompiled and stored in the PreparedStatement object. You can then use ...

Posted on Thu, 30 Apr 2020 05:14:46 -0700 by Spekta

[MySQL] build a master-slave replication environment for MySQL

I. software environment Mysql 5.7.21 Oracle Linux 7.1 II. Host settings Master IP: 10.24.33.186 Slave IP: 10.24.33.188 Three master slave configuration 1. Master configuration Create a replication user and grant the appropriate permissions: mysql> create user 'repl'@'10.24.33.188' identified by 'repl'; Query OK, 0 rows affected ( ...

Posted on Wed, 29 Apr 2020 22:57:25 -0700 by joe_C_nice

shell script 14: Enterprise case

14. Enterprise Actual Warfare Cases (1) Use the for loop to create 10 html files in batch in the / oldboy directory, where the file name contains 10 random lowercase letters to reinforce the fixed string 0ldoby. Idea analysis to generate random numbers: The core is to create 10 random lower case letters. Method 1: echo $RANDOM range is 0-32767 ...

Posted on Wed, 29 Apr 2020 09:37:56 -0700 by kparker

Recommend an IDEA code generator, double the efficiency of code writing!

Easycode is a plug-in of idea, which can generate entity,controller,service,dao,mapper directly to the data table. It is simple and powerful without any coding. 1. Installation (EasyCode) My words here are already loaded. I suggest you install a plug-in called Lombok.   Lombok It can automatically generate constructor, getter/setter, equals, h ...

Posted on Tue, 28 Apr 2020 21:35:50 -0700 by jwwceo