java JDBC connecting mysql database

Preface I have to admit the complexity of java code. concept 1 Parameters for creating database links String driver; String url; String user; String password; 2 load database class.formName(driver) 3 get database link Connection conn = DriverManager .getConnection(url,user,passwo ...

Posted on Sat, 02 May 2020 23:15:13 -0700 by tskweb

[java framework] JPA -- JPA Foundation

1. JPA Core API Objects 1.1.Persistence persisted object Persisitence is primarily used to create an EntityMangerFactory, which can create a corresponding EntityMangerFactory based on the persistence unit name passed in. // Corresponding profile persistence-unit name="cn.yif.jpa02" // Create an entity class management factory by persisting cla ...

Posted on Sat, 02 May 2020 16:26:24 -0700 by ShibSta

sqlalchemy foreign key Association

1, Create two tables and associate foreign keys Import ForenginKey module # -*- coding: UTF-8 -*- from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, DATE, Enum from sqlalchemy import ForeignKey from sqlalchemy.orm import sessionmaker engine = create_eng ...

Posted on Sat, 02 May 2020 16:05:45 -0700 by Kisses

Talk about getTransactionRows of binlogconnector replicator

order This paper focuses on the getTransactionRows of binlogconnector replicator BinlogConnectorReplicator maxwell-1.25.1/src/main/java/com/zendesk/maxwell/replication/BinlogConnectorReplicator.java public class BinlogConnectorReplicator extends RunLoopProcess implements Replicator { //...... private RowMapBuffer getTransactionRows(BinlogCo ...

Posted on Sat, 02 May 2020 12:48:51 -0700 by daniel_mintz

LINUX script listens to MYSQL

Method 1: monitor mysql port and process As a novice reference, the code is as follows: #!/bin/bash #liud #function: monitor mysql status, and start mysql in case of exception LOG_DIR=/data/monitor/ EMAIL_PATH=/server/scripts/email.txt LOG_FILE=mysql_`date +%Y-%m-%d`.log NowTime=`date +%Y-%m-%d_%H:%M:%S` DB_PATH=/etc/init.d/mysql # Log direc ...

Posted on Sat, 02 May 2020 00:58:57 -0700 by no_maam

Spring Boot JAP + MySQL practice

Reference Using STS to create a Spring Boot project Create a new Spring Boot project, and select Web, JPA, MySQL and other options when creating the project. Configuration information in application.yml shitibean based on annotation Simple application based on JPA interface Multi table and multi condition dynamic combined query and paging and ...

Posted on Sat, 02 May 2020 00:50:20 -0700 by gloeilamp

mysql slow query optimization: use limit when available

In many cases, we expect the query result to be at most one record data, so at this time, it is better to use limit 1. When this data is found, mysql will immediately terminate the query, and no more useless queries will be made, thus improving the efficiency. Let's actually test that in a mysql table with 100000 users, find lily's score (supp ...

Posted on Fri, 01 May 2020 08:57:19 -0700 by Ashoar

Solutions to mysql failure in CentOS 7.0 service startup

At noon, the company had a network problem (I didn't know the network problem at that time) and couldn't connect to SSH, so the server was forced to restart in Alibaba cloud's control panel. As a result, the mysql database couldn't be started, and an error was reported directly by running the mysql command Can't connect to local MySQL server t ...

Posted on Fri, 01 May 2020 08:02:04 -0700 by jlp09550

Mybatis generator reverse engineering setting does not generate Example class

Every time po and mapper are generated before, the Example class and its corresponding CURD method are generated. It's also troublesome to delete, so just let it not be generated. The specific configuration is very simple. You only need to turn off the generated method in the table tag of the table to be set. The code is as follows. &lt ...

Posted on Fri, 01 May 2020 06:36:12 -0700 by micmania1

Configure haproxy + preserved + PXC 5.7

There are many ways to separate reading from writing in MySQL. Haproxy + preserved + MySQL (master slave) is a common choice. This paper configures haproxy based on PXC 5.7 cluster environment and implements read-write separation of MySQL with Keepalived. The following are the main configuration methods and steps. 1, Current environment ...

Posted on Fri, 01 May 2020 00:49:09 -0700 by FeeBle