- 6.3.1 Authentication
- 6.3.2 Connection
- 6.3.3 Session
- 6.3.4 Networking
- 6.3.5 Security
- 6.3.6 Statements
- 6.3.7 Prepared Statements
- 6.3.8 Result Sets
- 6.3.9 Metadata
- 6.3.10 BLOB/CLOB processing
- 6.3.11 Datetime types processing
- 6.3.12 High Availability and Clustering
- 6.3.13 Performance Extensions
- 6.3.14 Debugging/Profiling
- 6.3.15 Exceptions/Warnings
- 6.3.16 Tunes for integration with other products
- 6.3.17 JDBC compliance
- 6.3.18 X Protocol and X DevAPI
Configuration properties define how Connector/J will make a
connection to a MySQL server. Unless otherwise noted, properties
can be set for a DataSource
object or for a
Connection
object.
Configuration properties can be set in one of the following ways:
-
Using the
set*()
methods on MySQL implementations ofjava.sql.DataSource
(which is the preferred method when using implementations ofjava.sql.DataSource
):com.mysql.cj.jdbc.MysqlDataSource
com.mysql.cj.jdbc.MysqlConnectionPoolDataSource
As a key-value pair in the
java.util.Properties
instance passed toDriverManager.getConnection()
orDriver.connect()
-
As a JDBC URL parameter in the URL given to
java.sql.DriverManager.getConnection()
,java.sql.Driver.connect()
or the MySQL implementations of thejavax.sql.DataSource
setURL()
method. If you specify a configuration property in the URL without providing a value for it, nothing will be set; for example, addinguseServerPrepStmts
alone to the URL does not make Connector/J use server-side prepared statements; you need to adduseServerPrepStmts=true
.NoteIf the mechanism you use to configure a JDBC URL is XML-based, use the XML character literal
&
to separate configuration parameters, as the ampersand is a reserved character for XML.
The configuration properties are categorized into the following sections, in which details for each property are given.