Connection database parameters
East 8 District, Beijing time
For example: MySQL database uses GBK code, while project database uses UTF-8 code. At this time, if useunicode = true & characterencoding = UTF-8 is added, the effect is as follows:
1. When saving data:
When the database stores the project data, it will first decode the data into bytecode in UTF-8 format, and then store the decoded bytecode in the database with GBK code again.
2. When taking data:
When fetching data from the database, the database will first decode the data in the database into bytecode in GBK format, then encode the decoded bytecode in UTF-8 format again, and finally return the data to the client.
Characterencoding = utf8 tells the database that this connection transmits utf8 data. The project is utf8, and the database is other encoding. During persistence, the utf8 data of the project will be converted into the format stored in the database. The same is true for data fetching from the database.
If the project and database are utf8, it is unnecessary to write
1. It can carry semicolon after SQL statement to realize multi statement execution.
2. It can execute batch processing and issue multiple SQL statements at the same time.
When the database connection is interrupted abnormally, do you want to connect again automatically?