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

ProxySQL official file translation

20_Mirroring Note: during the writing time of the article from April 201904 to may 201905, subsequent official updates in github were not written ~~Mirroringbe careful:1) Its rules can be changed at any time;2) It does not support prepare statements; 1, Extensions to MySQL query rules Modify MySQL query rules table and add 2 columns:1) mirror_ ...

Posted on Tue, 28 Apr 2020 04:27:53 -0700 by Hebbs

Query Log for ProxySQL Official Translation_u 08_ProxySQL Configuration

Query Log for 08_ProxySQL Configuration Note: Subsequent official updates to github were not written between 201904 and 201905~~ 1. Query Logging ProxySQL can record the query statements that pass through it (all statements, collectively referred to here as queries).Logs are configured with query rules, which allow logging to become broader or ...

Posted on Mon, 27 Apr 2020 10:34:31 -0700 by PhilVaz

gorm series - create record and field defaults

Catalog Gorm create record and field defaults Establish Default Using pointer to save zero value into database Using Scanner/Valuer interface to store zero value into database Gorm create record and field defaults CRUD usually refers to the operation of adding, deleting, modifying and querying the database Establish package main import ( ...

Posted on Mon, 27 Apr 2020 08:46:32 -0700 by Vasko