InterSystems IRIS Data Platform 2019.2  /  Using the InterSystems SQL Gateway

Using the InterSystems SQL Gateway
Connecting with the JDBC Driver
Previous section           Next section
InterSystems: The power behind what matters   

This chapter describes how to create a JDBC logical connection definition for the SQL Gateway. See Using Java JDBC with InterSystems IRIS for complete information on the InterSystems JDBC driver.
InterSystems IRIS maintains a list of SQL Gateway connection definitions, which are logical names for connections to external data sources. Each connection definition consists of a logical name (for use within InterSystems IRIS), information on connecting to the data source, and a username and password to use when establishing the connection. These connections are stored in the table %Library.sys_SQLConnection. You can export data from this table and import it into another InterSystems IRIS instance.
Controlling Gateway Logging and Java Version
To monitor SQL Gateway problems, you can enable SQL Gateway logging (see “SQL Gateway Logging”). You can specify the version of Java to be used with the SQL Gateway by setting the InterSystems IRIS JavaHome parameter (see JavaHome in the Parameter File Reference).
Defining a Logical Connection in the Management Portal
To define a gateway connection for a JDBC-compliant data source, perform the following steps:
  1. In the Management Portal, go to the System Administration > Connectivity > SQL Gateway Connections page.
  2. Click Create New Connection.
  3. On the Gateway Connection page, enter or choose values for the following fields:
    For example, a typical connection might use the following values:
    Setting Value
    Type JDBC
    Connection Name ConnectionJDBC1
    User JDBCUser
    Password JDBCPassword
    Driver name oracle.jdbc.driver.OracleDriver
    URL jdbc:oracle:thin:@//oraserver:1521/SID
    Class path /fill/path/to/ojdbc14.jar
    Properties oracle.jdbc.V8Compatibility=true; includeSynonyms=false;restrictGetTables=true
    For the other options, see “Implementation-specific Options.”
  4. Optionally test if the values are valid. To do so, click the Test Connection button. The screen will display a message indicating whether the values you have entered allow for a valid connection.
  5. To create the named connection, click Save.
  6. Click Close.
Creating a Connection between Namespaces
InterSystems IRIS provides JDBC drivers and can be used as a JDBC data source. That is, an InterSystems IRIS instance can connect to itself or to another InterSystems IRIS instance via JDBC and the SQL Gateway. Specifically, the connection is from a namespace in one InterSystems IRIS to a namespace in the other InterSystems IRIS. To connect in this way, you need the same information that you need for any other external database: the connection details for the database driver that you want to use. This section provides the basic information.
Connecting as a JDBC Data Source
To configure one Intersystems IRIS instance (IrisDB-1) to use another separate instance (IrisDB-2) as a JDBC data source, do the following:
  1. Within IrisDB-1, use the SQL Gateway to create a JDBC connection to the namespace in IrisDB-2 that you want to use.
    For example, a typical connection might use the following values:
    Setting Value
    Type JDBC
    Connection Name ConnectUser
    User _SYSTEM
    Password SYS
    Driver name com.intersystems.jdbc.IRISDriver
    URL jdbc:IRIS://
  2. Click Save.
  3. Click Close.
Implementation-specific Options
Before you define an SQL gateway connection, you should make sure that you understand the requirements of the external database and of the database driver, because these requirements affect how you define the connection.
Do Not Use Delimited Identifiers by Default
The Do not use delimited identifiers by default option controls the format of identifiers in the generated routines.
Select this check box if you are using a database that does not support delimited SQL identifiers. This currently includes the following databases:
Clear the check box if you are using any other database. All SQL identifiers will be delimited.
The Use COALESCE option controls how a query is handled when it includes a parameter (?), and it has an effect only when a query parameter equals null.
Whether you select this option depends on your preferences and on whether the external database supports the COALESCE function.
To find out whether the external database supports the COALESCE function, consult the documentation for that database.
Conversion in Composite Row IDs
The Conversion in composite Row IDs option controls how non-character values are treated when forming a composite ID. Choose an option that is supported by your database:
In all cases, the IDs are concatenated with|| between the IDs (or transformed IDs).
Consult the documentation for the external database to find out which option or options it supports.
SQL Gateway Logging
The InterSystems SQL Gateway can generate a log when used with JDBC. To enable this logging:
Enable logging only when you need to perform troubleshooting. You should not enable logging during normal operation, because it will dramatically slow down performance.

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-09-20 05:36:42