MySQL Connector/J 5.1 Developer Guide


This manual describes how to install, configure, and develop database applications using MySQL Connector/J 5.1, a JDBC driver for communicating with MySQL servers. It also contains information on earlier versions of Connector/J.

For notes detailing the changes in each release of Connector/J 5.1, see MySQL Connector/J 5.1 Release Notes.

For legal information, see the Legal Notices.

For help with using MySQL, please visit either the MySQL Forums or MySQL Mailing Lists, where you can discuss your issues with other MySQL users.

For additional documentation on MySQL products, including translations of the documentation into other languages, and downloadable versions in variety of formats, including HTML and PDF formats, see the MySQL Documentation Library.

Licensing information.  This product may include third-party software, used under license. If you are using a Commercial release of MySQL Connector/J 5.1, see this document for licensing information, including licensing information relating to third-party software that may be included in this Commercial release. If you are using a Community release of MySQL Connector/J 5.1, see this document for licensing information, including licensing information relating to third-party software that may be included in this Community release.

Document generated on: 2017-09-02 (revision: 53760)

Table of Contents

Preface and Legal Notices
1 Overview of MySQL Connector/J
2 Connector/J Versions
2.1 Connector/J Release Notes and Change History
2.2 Java Versions Supported
3 Connector/J Installation
3.1 Installing Connector/J from a Binary Distribution
3.2 Installing the Driver and Configuring the CLASSPATH
3.3 Upgrading from an Older Version
3.3.1 Upgrading to MySQL Connector/J 5.1.x
3.3.2 JDBC-Specific Issues When Upgrading to MySQL Server 4.1 or Newer
3.3.3 Upgrading from MySQL Connector/J 3.0 to 3.1
3.4 Installing from Source
3.5 Testing Connector/J
4 Connector/J Examples
5 Connector/J (JDBC) Reference
5.1 Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J
5.1.1 Properties Files for the useConfigs Option
5.2 JDBC API Implementation Notes
5.3 Java, JDBC and MySQL Types
5.4 Using Character Sets and Unicode
5.5 Connecting Securely Using SSL
5.6 Connecting Using PAM Authentication
5.7 Using Master/Slave Replication with ReplicationConnection
5.8 Mapping MySQL Error Numbers to JDBC SQLState Codes
6 JDBC Concepts
6.1 Connecting to MySQL Using the JDBC DriverManager Interface
6.2 Using JDBC Statement Objects to Execute SQL
6.3 Using JDBC CallableStatements to Execute Stored Procedures
6.4 Retrieving AUTO_INCREMENT Column Values through JDBC
7 Connection Pooling with Connector/J
8 Multi-Host Connections
8.1 Configuring Server Failover
8.2 Configuring Load Balancing with Connector/J
8.3 Configuring Master/Slave Replication with Connector/J
8.4 Advanced Load-balancing and Failover Configuration
9 Using the Connector/J Interceptor Classes
10 Using Connector/J with Tomcat
11 Using Connector/J with JBoss
12 Using Connector/J with Spring
12.1 Using JdbcTemplate
12.2 Transactional JDBC Access
12.3 Connection Pooling with Spring
13 Using Connector/J with GlassFish
13.1 A Simple JSP Application with GlassFish, Connector/J and MySQL
13.2 A Simple Servlet with GlassFish, Connector/J and MySQL
14 Troubleshooting Connector/J Applications
15 Known Issues and Limitations
16 Connector/J Support
16.1 Connector/J Community Support
16.2 How to Report Connector/J Bugs or Problems