Mysql Connector/J 8.0 Developer Guide Abstract

Mysql Connector/J 8.0 Developer Guide Abstract

MySQL Connector/J 8.0 Developer Guide Abstract This manual describes how to install, configure, and develop database applications using MySQL Connector/J 8.0, a JDBC and X DevAPI driver for communicating with MySQL servers. MySQL Connector/J 8.0 is highly recommended for use with MySQL Server 8.0, 5.7, and 5.6. Please upgrade to MySQL Connector/J 8.0. For notes detailing the changes in each release of Connector/J 8.0, see MySQL Connector/J 8.0 Release Notes. For legal information, including licensing information, see the Preface and Legal Notices. For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other MySQL users. Document generated on: 2021-09-23 (revision: 70881) Table of Contents Preface and Legal Notices .................................................................................................................. v 1 Overview of MySQL Connector/J ..................................................................................................... 1 2 Compatibility with MySQL and Java Versions ................................................................................... 3 3 What's New in Connector/J 8.0? ...................................................................................................... 5 4 Connector/J Installation ................................................................................................................... 7 4.1 Installing Connector/J from a Binary Distribution .................................................................... 7 4.2 Installing Connector/J Using Maven ....................................................................................... 9 4.3 Installing from Source ........................................................................................................... 9 4.4 Upgrading from an Older Version ........................................................................................ 11 4.4.1 Upgrading to MySQL Connector/J 8.0 ....................................................................... 12 4.5 Testing Connector/J ............................................................................................................ 16 5 Connector/J Examples ................................................................................................................... 19 6 Connector/J Reference .................................................................................................................. 21 6.1 Driver/Datasource Class Name ........................................................................................... 21 6.2 Connection URL Syntax ...................................................................................................... 21 6.3 Configuration Properties ...................................................................................................... 25 6.3.1 Authentication .......................................................................................................... 32 6.3.2 Connection .............................................................................................................. 33 6.3.3 Session ................................................................................................................... 36 6.3.4 Networking .............................................................................................................. 37 6.3.5 Security ................................................................................................................... 39 6.3.6 Statements .............................................................................................................. 43 6.3.7 Prepared Statements ............................................................................................... 44 6.3.8 Result Sets .............................................................................................................. 45 6.3.9 Metadata ................................................................................................................. 47 6.3.10 BLOB/CLOB processing ......................................................................................... 48 6.3.11 Datetime types processing ..................................................................................... 49 6.3.12 High Availability and Clustering ............................................................................... 52 6.3.13 Performance Extensions ......................................................................................... 57 6.3.14 Debugging/Profiling ................................................................................................ 61 6.3.15 Exceptions/Warnings .............................................................................................. 64 6.3.16 Tunes for integration with other products ................................................................. 65 6.3.17 JDBC compliance .................................................................................................. 65 6.3.18 X Protocol and X DevAPI ....................................................................................... 66 6.4 JDBC API Implementation Notes ......................................................................................... 69 6.5 Java, JDBC, and MySQL Types .......................................................................................... 72 6.6 Handling of Date-Time Values ............................................................................................. 74 6.6.1 Preserving Time Instants .......................................................................................... 74 6.6.2 Fractional Seconds .................................................................................................. 80 6.7 Using Character Sets and Unicode ...................................................................................... 80 6.8 Using Query Attributes ........................................................................................................ 83 6.9 Connecting Securely Using SSL .......................................................................................... 85 6.10 Connecting Using Unix Domain Sockets ............................................................................ 90 6.11 Connecting Using Named Pipes ........................................................................................ 90 6.12 Connecting Using Various Authentication Methods ............................................................. 91 6.12.1 Connecting Using PAM Authentication .................................................................... 91 6.12.2 Connecting Using Kerberos .................................................................................... 92 6.13 Using Source/Replica Replication with ReplicationConnection ............................................. 93 6.14 Support for DNS SRV Records ......................................................................................... 93 6.15 Client Session State Tracker ............................................................................................. 94 6.16 Mapping MySQL Error Numbers to JDBC SQLState Codes ................................................ 95 iii MySQL Connector/J 8.0 Developer Guide 7 JDBC Concepts ........................................................................................................................... 103 7.1 Connecting to MySQL Using the JDBC DriverManager Interface ..................................... 103 7.2 Using JDBC Statement Objects to Execute SQL ............................................................. 104 7.3 Using JDBC CallableStatements to Execute Stored Procedures ................................... 106 7.4 Retrieving AUTO_INCREMENT Column Values through JDBC .............................................. 108 8 Connection Pooling with Connector/J ........................................................................................... 113 9 Multi-Host Connections ................................................................................................................ 117 9.1 Configuring Server Failover for Connections Using JDBC ................................................... 117 9.2 Configuring Server Failover for Connections Using X DevAPI .............................................. 120 9.3 Configuring Load Balancing with Connector/J ..................................................................... 121 9.4 Configuring Source/Replica Replication with Connector/J .................................................... 123 9.5 Advanced Load-balancing and Failover Configuration ......................................................... 127 10 Using the X DevAPI with Connector/J: Special Topics ................................................................. 131 10.1 Connection Compression Using X DevAPI ....................................................................... 131 10.2 Schema Validation .......................................................................................................... 132 11 Using the Connector/J Interceptor Classes ................................................................................. 135 12 Using Logging Frameworks with SLF4J ...................................................................................... 137 13 Using Connector/J with Tomcat .................................................................................................. 139 14 Using Connector/J with Spring ..................................................................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    170 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us