Socket creation and connection

1. Define Socket status, SocketStatus.java /** * @Description: The status of the Socket connection */ public interface SocketStatus { /** * disconnected */ int SOCKET_DISCONNECTED = 0; /** * connecting */ int SOCKET_CONNECTING = 1; /** * connected */ int SOCKET_CONNECTED = 2; /** * Disconnecting */ int SOCKET_DISCONNECTING = 3; } 2. Create a […]

JDBC – Java Database Connection

Article directory 1. Database Tools 2. JDBC – Java Database Connection 3. Execute the DML statement Fourth, execute the DQL statement 5. Association query 6. Execute precompiled SQL statements Seven, SELECT statement 8. Practice creating a table: student1 9. Insert 100 pieces of data into the student1 table 10. Delete the student whose name is […]

No 3. Integrate Druid MySql data connection pool

No 3. Integrate Druid MySql data connection pool Reference: https://www.cnblogs.com/teacher11/p/15222574.html 1. Add dependencies <!– Ali database connection pool fhadmin.cn –> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.22</version> </dependency> 2. Configure connection pool monitoring html Access link: http://127.0.0.1:9527/druid/datasource.html 2.1 Bean configuration Update: application.properties server.port=9527 # =======ali mysql datasource ========================# spring.datasource.type=com.alibaba.druid.pool.DruidDataSource # ================================ MySQL ================= ==================================================== =========== spring.datasource.url = jdbc:mysql://127.0.0.1:3306/jwtdb?serverTimezone=GMT+8 […]

Full disclosure! Linux system directory and network connection for the perfect landing of big data from 0 to 1

Introduction to Linux Directory Directory Description Table of Contents Description, Description / The root directory of Linux /bin binaries, the directory for storing system commands, all users can execute /sbin super user binaries, save commands related to system environment settings, only super users can use these commands, some commands can allow ordinary users to view […]

[Database JDBC] Establish a connection between the database and java code

Foreword: Hello everyone, I am Liangchen, JDBC is called Java Database Connectivity, which can be called Java Database Connectivity. It can connect java code with sql statement. Isn’t it amazing? Let’s slowly learn the related operations of JDBC. Personal homepage: Good day needle does not poke Column: Database Inspirational statement: Life may make us bruised […]

KylinV10 offline installation mysql8.0.32 modify port, modify password, develop connection permissions

Foreword Record the offline installation of the latest Mysql8.0.32 on KylinV10, and the pitfalls encountered 1. Prepare 1. Uninstall mariadb If there is an old version of MariaDB in the system, if you install MySQL directly, it will conflict with MariaDB files. To be on the safe side, first uninstall the built-in MariaDB, and then […]

java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempt

When doing springboot + flowable bpm, the following error is reported 2023-03-24 08:57:43.564 ERROR 79604 — [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 – Exception during pool initialization. java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[mysql-connector-java-8.0.23.jar:8.0.23] […]

Python3 MySQL database connection – PyMySQL driver

foreword What is PyMySQL? PyMySQL installation Database Connectivity Example: Create database tables database insert operation Database query operation Example: Database update operation delete operation Execute business example error handling Foreword What is PyMySQL? PyMySQL is a library used to connect to the MySQL server in Python3.x, and mysqldb is used in Python2. PyMySQL follows the […]

ReentrantLock implements PV operation – simulates multi-threaded competition for database connection pool resource scenarios

Use ReentrantLock + Condition to simulate PV operation, realize multi-threaded competition for database connection pool resources, block waiting after resources are exhausted, and wake up blocked threads after returning resources (in the code, 10 threads compete for 5 database connection resources) ConnectionPool.class (connection pool) Connection.class (connection object) ConnectionState.class (connection state enumeration) Application.class (program entry) operation […]