Chapter 4 MySQL Cluster Connector for Java

Table of Contents

4.1 MySQL Cluster Connector for Java: Overview
4.1.1 MySQL Cluster Connector for Java Architecture
4.1.2 Java and MySQL Cluster
4.1.3 The ClusterJ API and Data Object Model
4.2 Using MySQL Cluster Connector for Java
4.2.1 Getting, Installing, and Setting Up MySQL Cluster Connector for Java
4.2.2 Using ClusterJ
4.2.3 Using JPA with MySQL Cluster
4.2.4 Using Connector/J with MySQL Cluster
4.3 ClusterJ API Reference
4.3.1 Package com.mysql.clusterj
4.3.2 Package com.mysql.clusterj.annotation
4.3.3 Package com.mysql.clusterj.query
4.3.4 Constant field values
4.3.5 Statistics
4.4 MySQL Cluster Connector for Java: Limitations and Known Issues

This chapter discusses using MySQL Cluster with MySQL Cluster Connector for Java, which includes ClusterJ and ClusterJPA, a plugin for use with OpenJPA, both of which became available in MySQL Cluster NDB 7.1.

ClusterJ is a high level database API that is similar in style and concept to object-relational mapping persistence frameworks such as Hibernate and JPA. Because ClusterJ does not use the MySQL Server to access data in MySQL Cluster, it can perform some operations much more quickly than can be done using JDBC. ClusterJ supports primary key and unique key operations and single-table queries; it does not support multi-table operations, including joins.

ClusterJPA is an OpenJPA implementation for MySQL Cluster that attempts to offer the best possible performance by leveraging the strengths of both ClusterJ and JDBC. ID lookups and other such operations are performed using ClusterJ, while more complex queries that can benefit from the MySQL query optimizer are sent through the MySQL Server, using JDBC.