java TestNgFramework for automated testing framework
Building TestNg test framework requires installation of testNg plug-in.
Download address: http://testng.org/doc/download.html
http://dl.bintray.com/testng-team/testng-eclipse-release/zipped/6.14.0.201802161500/(Download the latest version of 6.14.0)
After downloading, decompress and put the corresponding files in eclipse.
You can also install plug-ins online.
TestNgJar package required for frame construction: com.beust.jcommander_1.72.0.jar
...
Because it is difficult to query every time you connect to the database, you occasionally need to convert the query results to a JSON file.
So temporarily define a MySQL class that encapsulates these commonly used methods for direct invocation (code is as follows, for personal use, without any comments).
Note: the package of https://github.com/stleary/JSON-java is imported.
1 package connmysql;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5 import java.sql.Connection;
6 import java.sql.DriverManager;
7 import java.sql.PreparedStatement;
8 import java.sql.Res...
ACID(Atomicity Atomicity, Consistency consistency, Isolation isolation, Durability persistence) are a series of attributes.
These attributes ensure the reliability of database objects. In a database, a series of operations on data can be logically viewed as a whole operation, which is called things.
Atomicity” (atomicity)
Atomicity requires that all operations in each thing be either complete or as if none of them happened: if some of the operations in the thing fail, the whole thing fails, and the result is that the state in the database remains unchanged. Atomicity systems must ensu...
Cursor
Cursors are used to process multiple rows of records retrieved from the database (using SELECT statements). Using cursors, programs can process and traverse the entire recordset returned once retrieved one by one.
To process the SQL statement, Oracle will allocate a region in memory, which is the context area. This section contains the number of processed rows, pointers to the analyzed statement, and the entire section is the data row set returned by the query statement. The cursor refers to the handle or pointer of the context area.
Two. Classification of cursors:
...
If the delete statement has a query, the wrong way to write will result in no indexing.
Simple and crude way: remove two SQL, a query, a delete
=======================
【No index writing.
DELETE FROM goods_item_combo_group_item_history
WHERE group_id IN (SELECT id
FROM goods_item_combo_group_history
WHERE lease_code = 'schjyzzh'
AND item_code = 'YL180606110506793'
AND gmt_modified = '2018-06-07 23:18:51')
【Index writing
DELETE goods_item_combo_group_item_history
FROM goods_item_combo_group_item_history, goods_item_combo_group_history
WHERE goods_item_...
1.How to count the number of different values of the same column in the same query, so as to reduce the number of queries.
For example, suppose you need to return the number of list menus at different levels through a query, you can query by the following statement:
select SUM(IF(functionlevel=’0′,1,0)) as Level 1, SUM (IF (functionlevel=’1′, 1,0)) as second,SUM(IF(functionlevel=’2′,1,0)) as Level third, SUM (IF (functionlevel=’3′, 1,0)) as fourth, SUM (IF (functionlevel=’4′, 1,0)) as fifth., SUM(IF(functionlevel=’5′,1,0)...
1 create or replace procedure procedure_name --Stored procedure name
2 (
3 --Input / output quantities _name in out quantity type
4 --e.g.
5 username in varchar2, --varchar2Type does not need to indicate length.
6 id out number(38)
7 )
8 is/as
9 --Basically, is and as are the same, but slightly different, in this section you declare variables and constants // like the declare section in the PL / SQL statement block
10
11 --Variable / constant ...
classloader
Class loader (ClassLoader) is used to load class bytecode to Java virtual machine. In general, Java virtual machines use Java classes in the following way: Java source files are converted to Java after passing through JavacBytecode file (.Class file). The class loader is responsible for reading the Java byte code and converting it into an instance of the java.lang.Class class. Each of these instances is used to represent a Java class. The actual situation may be more complicated, for example.Java byte code may be generated dynamically by tools or downloaded through the network.
...