MySQL Connector_J_5.1.34_2014.10, mysqlconnector
Version 5.1 complies with JDBC3.0 and JDBC4.0 specifications
Compatible with MySQL4.1-5.7
5.1.21 and later support the JDBC4.1 specification of JDK 7
Utf8 is not supported before MySQL4.1
Com. mysql. jdbc. Driver is the recommended Driver, and org. gjt. mm. mysql. Driver is a previous
JdbcURL format:
Jdbc: mysql: // [host: 3306].../[database]»
[? PropertyName1] [= propertyValue1] [& propertyName2] [= propertyValue2]...
If no database is specified, we recommend that you use Connection. setCatalog () instead of the SQL statement "use database"
Disaster recovery hosts only support the automatic commit mode because transactions cannot be guaranteed.
Only read-only queries can be performed.
You can configure connection attributes by using the following methods:
1. java. SQL. DataSource. setXXX ()
2. DriverManager. getConnection (Properties)
3. DriverManager. getConnection (URL), or java. SQL. DataSource. setURL ()
It can be the following attributes:
User, passwod, passwordCharacterEncoding
ConnectTimeout = 0 millisecond interactiveClient = false idle time to replace wait time
AllowMultiQueries = false. The statement cannot contain semicolons and does not affect batch processing.
DefaultFetchSize = 0
UseUnicode defaults to true
CharacterEncoding is automatically detected by default.
CharacterSetResults
ContinueBatchOnError = true
EmptyStringsConvertToZero = true, the empty string is changed to '0'
MaxRows =-1 returns an unlimited number of rows
TinyInt1isBit = true, transformedBitIsBoolean = false
UseTimezone: the time zone is automatically converted between the client and the server. The default value is false.
ZeroDateTimeBehavior = exception. if the date is 0, it is considered as an exception. Optional values: "exception", "round" and "convertToNull ".
Named Pipes are 30%-50% faster than TCP/IP, but worse in windows.
The Connection. isClosed () method only checks whether the close () method has been called.
If you want to check whether an SQL statement can be run, if an exception is thrown, It is disabled.
Foreign keys can only be used on InnoDB
Try not to use Statement. cancel ()
MySQL does not support cursors.
Character_set_server system variable, set the server Encoding
When setting encoding on the client, use java-style, UTF-8, GBK,
Mysql-style utf8 and gbk are used when encoding is set on the server.