On the analysis of 8 kinds of SQL errors
Execution order of SQL statement:
FROM
<left_table>
ON
<join_condition>
<join_type>
JOIN
<right_table>
WHERE
<where_condition>
GROUP BY
<group_by_list>
HAVING
<having_condition>
SELECT
DISTINCT
<select_list>
ORDER BY
<order_by_condition>
LIMIT
<limit_number>
1. LIMIT stateme ...
Posted by Notoriouswow on Tue, 22 Oct 2019 03:12:33 +0200
Encapsulating query, adding, deleting, modifying and connecting database
encapsulation
BaseDao
What if the parameter, quantity and type are not fixed?
public class TestMethod {
//First, method overload
/*public int sum(int a) {
return a;
}
public int sum(int a,int b) {
return a+b;
}
public int sum(int a,int b,int c) {
return a+b+c;
}*/
//Method 2, put an arra ...
Posted by anand on Sun, 20 Oct 2019 16:43:04 +0200
Interpretation of new features | MySQL 8.0.18 replication with permission control
Original: Replication with restricted privileges
https://mysqlhighavailability.com/replication-with-restricted-privileges/
By Pedro Figueiredo
Guan Changlong
background
Before MySQL 8.0.18, the slave server performed replication transactions without checking permissions, so that the master server could get all the content. In fact, this mea ...
Posted by Tsukasa on Fri, 18 Oct 2019 11:12:07 +0200
Configuration and use of MyBatis (add, delete, change, check)
- Restore content to start
Introduction to Mybatis
Introduction to MyBatis
What is MyBtis?
MyBatis is an open source framework that simplifies and implements the Java data persistence layer. It abstracts a lot of JDBC redundant code and provides a simple and easy-to-use API and database interaction.
MyBatis's predecessor was iBATIS, which ...
Posted by mcdsoftware on Sun, 13 Oct 2019 08:47:03 +0200
java multithreading: application of Callable and FutureTask
brief introduction
Callable
Callable is a class similar to Runnable. The main difference is that Callable can return results, but Runnable does not.
FutureTask
Simply put, FutureTask can be enabled, cancelled, and used with Callable and Runnable to determine whether the thread is complete. When used together with Callable, the return result can ...
Posted by hdpt00 on Fri, 11 Oct 2019 16:33:46 +0200
MySQL Execution Plan -- Reasonable Utilization of Implicit Business Logic
Problem description
An SQL was encountered in the optimization process:
SELECT
SUM(user_value)
FROM user_log
WHERE del_flag = 0
AND product_id = 2324
AND user_type = 1;
Its implementation plan is as follows:
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: use ...
Posted by tensitY on Fri, 11 Oct 2019 16:15:26 +0200
java changes the insert batch in the oracle export table sql file to update
Recent business needs to change a table to an update statement because the only primary key relationship is set and the direct insert will be abnormal, so I changed all insert statements to update statements.
1. this is the sql file exported from a colleague's computer.
prompt Importing table gams_jc_ ...
Posted by Nabster on Thu, 10 Oct 2019 03:40:40 +0200
Notes on the Development of Yii 2.0+
1. AR mode removes the automatic sorting function
public function search($params)
{
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => false, // Remove automatic sorting
]);
2. Scalar Query
The corresponding table of Book model is book, and the parameter value o ...
Posted by jjrosen on Tue, 08 Oct 2019 23:45:13 +0200
Day4_JDBC-BaseDao Class Optimization
I. analysis.
From last article Day3_JDBC - Encapsulation of Addition, Deletion and Change Checks (BaseDao class) using DBUtils third-party tools As you can see, every method in the BaseDao class needs to pass in a type of entity class (that is, JavaBean type). If we inherit the BaseDao class, we tell ...
Posted by bellaso on Tue, 08 Oct 2019 12:16:30 +0200
JDBC Quick Start, idea Edition
JDBC: Java DateBase Connectivity
Essence: JDBC is an official set of specifications, interfaces for connecting database operations. The code that actually runs is the code of the implementation class in the jar package provided by the database vendor.
Example:
1. Importing jar packages
Create a folder n ...
Posted by joe__ on Mon, 07 Oct 2019 10:34:28 +0200