Java database development (1): JDBC connection database
1, MySQL database
1. Create database
CREATE DATABASE jdbc CHARACTER SET 'utf8';
2. build tables
CREATE TABLE user (
id int(10) NOT NULL AUTO_INCREMENT,
userName varchar(20) NOT NULL,
PRIMARY KEY (id)
);
3. Add data
2, Connect MySQL database through JDBC
1.JDBC URL
2.Statement
boolean execute(String SQL): if the ResultSet object can be ...
Posted by katlis on Sun, 29 Mar 2020 11:35:55 -0700
redis master-slave configuration (one master-many slave)
Introduction of Master and Subordinate
redis installation
1. Master-Subordinate-Usage
Like MySQL, redis support master-slave synchronization, as well as a master-slave and multilevel slave structure.
The primary-slave architecture is designed for purely redundant backups, and for improved read perf ...
Posted by SpaceLincoln on Sat, 28 Mar 2020 10:36:48 -0700
The use of BeanListHandler interface in DBUtils
Original link: http://www.yiidian.com/dbutils/dbutils-beanlisthandler.html
org.apache.commons.dbutils.BeanListHandler is the implementation of the ResultSetHandler interface, and is responsible for converting all records at the ResultSet result level to the List collection of JavaBean s. This class is thread safe.
1 syntax for beanlisthandler
L ...
Posted by codygoodman on Sat, 28 Mar 2020 07:55:12 -0700
hive-1.2.1 Installation and Simple Use
Hive can only be installed on one node
1. Upload tar package
2. Decompression
tar -zxvf hive-1.2.1.tar.gz -C /apps/
3. Install mysql database (switch to root user) (there are no limitations on where to install, only nodes that can connect to the hadoop cluster)
4. Configure hive
(a) Configure the HIVE_HOME environment variable vi conf/hive-e ...
Posted by gyash on Thu, 26 Mar 2020 21:12:15 -0700
2020Python job 15 -- decorator 2 + iterator
@2020.3.24
(Q1)
Homework:1. Compile the parametric decorator explained in class
def auth(db_type = 'file'):
def inner(func):
def wrapper(*args, **kwargs):
inp_name = input("your name:").strip()
inp_pwd = input("your password:").strip()
if db_type == 'file':
with open(r'd ...
Posted by JayNak on Wed, 25 Mar 2020 07:33:21 -0700
2020Python job 15 -- decorator 2 + iterator
@2020.3.24
(Q1)
Homework:1. Compile the parametric decorator explained in class
def auth(db_type = 'file'):
def inner(func):
def wrapper(*args, **kwargs):
inp_name = input("your name:").strip()
inp_pwd = input("your password:").strip()
if db_type == 'file':
with open(r'd ...
Posted by jv2222 on Wed, 25 Mar 2020 07:31:33 -0700
MySQL data backup and recovery -- xtrabackup tool
The previous article introduced the logical backup tool mysqldump. This article will demonstrate the second part of data backup and recovery by using xtrabackup, a more popular physical backup tool.
1. Installation of xtrabackup tool
1.1 installation dependency package
/* xtrabackup You need to install the related dependency package to use th ...
Posted by blear on Wed, 25 Mar 2020 05:45:51 -0700
Performance comparison between golang sqlx and db.v3
Recently, when communicating with a big guy, I mentioned the problem of SQL query.
His idea is to query data with the most primitive database driver without ORM. The benefits of doing so are twofold
Express SQL semantics clearly for later optimization. Especially in report, data analysis and other complex SQL.
Reduce useless encapsulation and ...
Posted by Sravan on Tue, 24 Mar 2020 07:29:38 -0700
Technology sharing | how to use bcc tools to observe MySQL latency
Author: Liu An
A member of the test team of akesheng, who is mainly responsible for the related test tasks of TXLE open source project, is good at Python automatic test development, and is recently absorbed in the relevant knowledge of Linux performance analysis and optimization.
Source: original contribution
*Aikesheng is produced by the op ...
Posted by alex57 on Tue, 24 Mar 2020 02:54:48 -0700
Understand how MySQL judges whether InnoDB table is an independent table space or a shared table space
This article refers to the original- http://bjbsair.com/2020-03-22/tech-info/5348/Summary
InnoDB stores data in the form of tablespace, In the default configuration, there will be a file with the initial size of 10MB and the name of ibdata1. This file is the default tablespace file. Users can set it with the parameter InnoDB? Data? File? Path. ...
Posted by MatrixDancer on Mon, 23 Mar 2020 21:45:36 -0700