InterSystems Java Connectivity Options
InterSystems IRIS® provides a wide variety of robust Java connectivity options:
Core Data Access APIs provide lightweight data access via relational tables, objects, or globals.
InterSystems Object Gateway provides an easy way access and manipulate both ObjectScript and Java objects using the same context and connection.
InterSystems SQL Gateway provides customized connections to external databases and Java applications through an SQL interface.
Third Party Framework Support includes interface implementations for Spark and Hibernate.
The InterSystems JDBC driver is at the core of all InterSystems IRIS Java solutions. It is a powerful Type 4 (pure Java) fully compliant implementation of the JDBC API, closely coupled to InterSystems IRIS for maximum speed and efficiency.
Core Data Access APIs
The InterSystems JDBC driver supports three lightweight Java APIs that provide direct access to InterSystems IRIS databases via relational tables, objects, and multidimensional storage.
The Core Data Access APIs and the Object Gateway form an integrated suite of utilities that can all share the same underlying JDBC connection context. Your application can use any combination of desired features from any part of the suite.
The InterSystems JDBC driver (described in this book) provides SQL based access to relational tables. It supports the following features:
relational access
store and query tables via SQL
stored JDBC tables can be accessed as InterSystems IRIS objects
JDBC API optimized for InterSystems IRIS
fully implemented type 4 (pure Java) JDBC API
extensions for unique InterSystems IRIS property settings
high speed batch reads
automatic connection pooling
support for third party Java frameworks
optimized Spark JDBC data source API
Hibernate support
Detailed information is provided in later chapters of this book, and in the “JDBC Driver Support” chapter of the Implementation Reference for Java Third Party APIs.
The InterSystems XEP API is designed for extremely fast acquisition of data objects in real time, and can also be used as a convenient general purpose ORM interface. It supports the following features:
optimized for speed
ultra-high speed real-time data acquisition. It can acquire data many times faster than standard JDBC.
batch reads
fine control over data serialization
object-based access
lightweight alternative to Hibernate
store and query objects (create/read/update/delete)
schema import and customization
mapping for most standard datatypes
stored objects can also be accessed as JDBC tables
full process control
control indexing and fetch level
control transactions and locking
See Persisting Java Objects with InterSystems XEP for details.
The InterSystems Native API is a lightweight toolset that gives your Java applications access to resources formerly available only through ObjectScript. It supports the following features:
directly access and manipulate global arrays
create and delete nodes
iterate over nodes and create/read/update/delete values
control transactions and locking
call server-side ObjectScript code:
call methods and access properties from any compiled class
call functions or procedures from any compiled .mac file
Create Java server applications that give ObjectScript clients direct access to Java objects via the Object Gateway.
See Using the Native API for Java for details.
InterSystems Object Gateway
The Object Gateway provides an easy way access and manipulate both ObjectScript and Java objects in the same context, using the same connection. The Gateway is completely reentrant, allowing Java applications to manipulate ObjectScript objects and ObjectScript applications to manipulate Java objects, both using the same connection context (database, session and transaction) and physical connection.
ObjectScript applications can also use ODBC as an alternate connectivity option (providing access to .NET objects and ADO) without any major changes in your ObjectScript code.
See Using the Object Gateway for Java for detailed information.
InterSystems SQL Gateway
The InterSystems SQL Gateway connects InterSystems IRIS to external databases via JDBC. Various wizards can be used to create links to tables, views, or stored procedures in external sources. This allows you to read and store data in the external database just as you would on InterSystems IRIS, using objects and/or SQL queries. You even can generate class methods that perform the same actions as corresponding external stored procedures.
Gateway applications are written in ObjectScript and run on the server. They can also use ODBC as an alternate connectivity option (providing access to .NET objects and ADO) without any major changes in your ObjectScript code.
See Using the SQL Gateway for detailed information on both JDBC and ODBC options.
Third Party Framework Support
Java frameworks such as Spark and Hibernate use JDBC to interact with databases, and include interfaces that can be implemented to take advantage of features unique to a specific database. InterSystems IRIS provides implementations of the Spark Data Source interface and the Hibernate Dialect interface.
The InterSystems Spark Connector is an implementation of the Data Source API for Apache Spark. It is a plug-compatible replacement for the standard Spark jdbc data source, allowing the Spark data processing engine to make optimal use of InterSystems IRIS and its distributed data capabilities
See Using the InterSystems Spark Connector for details.
The InterSystems Hibernate Dialect is a fully compliant implementation of the Hibernate dialect interface, providing a customized interface between Hibernate and InterSystems IRIS. Like most major dialect implementations, it is included as part of the Hibernate distribution.
See the “Hibernate Support” chapter in the Implementation Reference for Java Third Party APIs for details.