Java Persistence Architecture (JPA) is the recommended persistence technology for complex object hierarchies in Java projects. Caché and Ensemble currently support JPA 1.0 and 2.0 via the Hibernate implementations of the JPA specifications. See “Using the Caché Hibernate Dialect” in Using Caché with JDBC.
Extreme Event Persistence (XEP) is the recommended persistence technology for high-performance simple to medium complexity object hierarchies in Java projects. See “Using XEP Event Persistence” in Using Java with Caché eXTreme.
Welcome to the Caché Java Binding and JDBC QuickStart Tutorial! This tutorial provides a quick, hands-on introduction to using the fast, efficient, and flexible Caché database with your Java applications.
Caché provides you with several different options for connecting your Java applications to Caché:
The Java Binding Mechanism: Connects your application's objects directly to object representations of your data (Caché Objects). Removes the need for SQL and cumbersome object-relational mappings.
The Caché JDBC Driver: Provides a standard relational interface to your Caché data. Use the driver together with SQL and the java.sql API.
Caché eXtreme: A set of APIs that allow Java applications to communicate with Caché using an in-memory connection rather than TCP/IP.
The first two options are appropriate for situations in which you have existing Caché database schemas and perhaps data and you wish to connect them to Java applications. The third option is appropriate for high performance XTP (Extreme Transaction Processing) applications. This tutorial covers the first two of these options. See Using Java with Caché eXtreme for information on the third option.
The tutorial is divided into two independent parts, one part for each mechanism. Since the parts are independent, they can be completed in any order.
Complete Part I: The Java Binding Mechanism to learn more about using the Java Binding Mechanism.
Complete Part II: Caché and JDBC to learn more about using the Caché JDBC driver.
Click here for general Java-related system requirements for using Caché with Java applications.
The tutorial examples and exercises involve a Caché application, the Contact Management application as well as several Java source files. Click here for instructions for installing the Contact Management application, as well as descriptions of the Java files.
The Caché installation includes several code samples that demonstrate the Java Binding Mechanism and the Caché JDBC driver. The source files and class files containing this code can be found in <cachesys>\Dev\java\samples. In a standard Windows installation <cachesys> is in C:\InterSystems\Cache. In standard UNIX® or Linux installations, <cachesys> is /usr/cachesys.