Using JDBC with InterSystems IRIS
Introduction to InterSystems JDBC
The InterSystems IRIS data processing platform includes a high-performance type 4
JDBC database driver. The InterSystems JDBC driver is fully compliant with the JDBC 4.1 API, supporting all required interfaces and adhering to all JDBC 4.1 guidelines and requirements.
You can use the InterSystems JDBC driver and SQL when you want to access your InterSystems IRIS data using a relational model. The Java Binding mechanism also uses the JDBC driver. You can mix relational and object-oriented database access to provide maximum flexibility to your application.
Using the JDBC Driver
Installation and Configuration
All applications using the InterSystems IRIS Java binding are divided into two parts: an InterSystems IRIS server and a Java client. The InterSystems IRIS server is responsible for database operations as well as the execution of InterSystems IRIS object methods. The Java client is responsible for the execution of all Java code (such as additional business logic or the user interface). When an application runs, the Java client connects to and communicates with an InterSystems IRIS server via a TCP/IP socket. The actual deployment configuration is up to the application developer: the Java client and InterSystems IRIS server may reside on the same physical machine or they may be located on different machines. Only the InterSystems IRIS server machine requires a copy of InterSystems IRIS.
The InterSystems IRIS Java client requires the a supported version of the Java JDK. Client applications do not require a local copy of InterSystems IRIS.
InterSystems IRIS Server Configuration
Very little configuration is required to use a Java client with an InterSystems IRIS server. The Java sample programs provided with InterSystems IRIS should work with no change following a default InterSystems IRIS installation. This section describes the server settings that are relevant to Java and how to change them.
Every Java client that wishes to connect to an InterSystems IRIS server needs a URL that provides the server IP address, TCP port number, and InterSystems IRIS namespace, plus a username and password.
To run a Java or JDBC client application, make sure that your installation meets the following requirements:
To connect to the InterSystems IRIS server, the client application must have the following information:
The IP address of the machine on which the InterSystems IRIS Superserver is running. The Java sample programs use the address of the server on the local machine (localhost
). If you want a sample program to connect to a different system you will need to change its connection string and recompile it.
The TCP port number on which the InterSystems IRIS Superserver is listening. The Java sample programs use 1972
(the default). If you want a sample program to use a different port you will need to change its connection string and recompile it.
A valid SQL username and password. You can manage SQL usernames and passwords on the [System Administration] > [Security] > [Users]
page of the Management Portal. The Java sample programs use the administrator username, "_SYSTEM"
and the default password "SYS"
. Typically, you will change the default password after installing the server. If you want a sample program to use a different username and password you will need to change it and recompile it.
The server namespace containing the classes and data that your client application will use.
The InterSystems IRIS Java Class Packages
The Java class packages are contained in the following files: