NTi Data Provider overview
Introduction
NTi Data Provider is an IBM i access provider designed for .NET. It provides fully integrated, native access to .NET technology for:
- Execute CL commands
- Call existing IBM i programs (RPG, CLP ...)
- Access DB2 for i database
- Access spool files
.NET AND THE COMMON LANGUAGE RUNTIME
The .NET technology introduced by Microsoft is a must-have for business application development. Thanks to the popularity of its C# language, .NET enjoys a large, active and dynamic community. Taking advantage of all IBM i resources in modern .NET Core applications is a major challenge for many customers today. The new versions of .NET 6 and 8 are cloud-oriented and cross-platform. No longer tied to a particular architecture or operating system, applications are now portable and can be run in any environment. Containerized on Linux on Power or deployed as a Windows x86 fat client, applications are platform agnostic. Access to IBM i resources must also be platform agnostic, and we must forget about drivers compiled in native code and other legacies of 90s technologies such as ODBC or OleDB. When you're doing .NET, you only want .NET, and that's exactly what AUMERIAL offers with NTi.
To run on all platforms, applications and modules developed in .NET use components available in a library called CLR (Common Language Runtime). The CLR contains all the fundamentals needed to perform the various operations and interact with the hardware. Each architecture has its own CLR implementation, ensuring that all applications built on these components run natively on these architectures.
NTI DATA PROVIDER, AUMERIAL'S ANSWER TO AGING DRIVERS
To connect to IBM i systems from .NET, drivers such as ODBC or Ole-DB are required. These drivers are written and compiled in machine code according to the architecture, and are totally outside the scope of the CLR provided by .NET. Access is not provided by .NET and the resulting application is not cross-platform. Faced with this situation and the lack of a satisfactory solution to this problem, we developed NTi, a provider of access to IBM i resources for .NET, based entirely on .NET CLR resources.
This means that all the tasks involved in accessing the IBM i, from establishing a connection to converting code pages, are carried out by code that is portable to all platforms. As a result, with NTi, there are no constraints on application deployment. Business applications can be deployed anywhere, with no limits.
HOW NTI WORKS IN DETAIL
GENERAL CONNECTION INFORMATION
NTi connects to the IBM i by establishing TCP/IP connections with the following jobs (or their SSL counterparts where applicable):
- QZDASOINIT for the database
- QZRCSRVS for programs and commands
- QZSOSIGN for the Signon
These connections are established using standard components available in the .NET CLR. NTi then submits the various requests to the IBM i, sending the appropriate DataStreams. All data conversion and text encoding/decoding is performed by NTi. Due to its highly object-oriented nature, .NET code is instance-based. Unnecessary instances are regularly destroyed by .NET in the interests of memory optimization. With NTi, the TCP/IP connection to the IBM i is associated with the instance of the current NTi connection. So when this connection is destroyed, the TCP socket is closed and then destroyed, and the corresponding IBM i job stops. This principle creates a strong coupling between NTi instances and IBM i jobs, eliminating the problem of IBM i jobs remaining active (QZDASOINIT “ghosts”).
Note: Exchanges between NTi and the IBM i can be traced using the IBM i's built-in TCP trace functions (STRTRCTCP).
CONNECTION CONFIGURATION
By default, the user provides the IP address or host name of the IBM i LPAR to be reached, and the default ports are used:
SERVICE | PORT NON SSL | PORT SSL |
---|---|---|
PORT MAPPER | 449 | N/A |
SIGNON | 8476 | 9476 |
DATABASE | 8471 | 9471 |
COMMANDS/PROGRAMS | 8475 | 9475 |
The user can also choose to specify the port numbers to be used to connect to the various services. If the configuration is not standard and the ports are unknown, the user can choose to use the port mapper, which defaults to port 449. This port can also be specified if modified. The user also chooses whether or not the connection should use SSL/TLS. SSL must, of course, be configured upstream in order to establish this type of connection. If required, it is possible to force trust in the IBM i certificate and still use SSL.
Important : NTi connection is only possible if the corresponding TCP servers on the IBM i (*DATABASE, *RMTCMD, *SIGNON and *SVRMAP) are active.
FEATURES
Database access
Through implementation of the ADO.NET model, NTi offers total access to the IBM i database via methods and syntax known to all:
- Immediate execution of SQL queries
- Execution of prepared and parameterized SQL queries
- Execute SQL procedures with or without input/output parameters
- Open and read cursors returned by SQL queries or procedures
- Retrieve data from LOB fields (BLOB, CLOB, XML, Geospatial)
- Validation control (transactions)
- Support for all data types
CL command execution and program calls
In addition to the database part, NTi offers methods for calling CL commands and IBM i programs without using SQL:
- CL command execution
- Program/api calls with or without input/output parameters
CL commands and IBM i program calls are made to the dedicated AS-RMTC® server. SQL is thus completely dispensed with in these use cases.
NTI IMPLEMENTATION
CLIENT SIDE (.NET)
Initial configuration
On the client side, no configuration is required. All you need is access to the targeted IBM i partition to use NTI. You also need to install the .NET runtime on your machine. No need for ACS either, as everything is embedded in the .NET package.
Download
NTi can be downloaded directly via the NuGet.org platform, integrated into Visual Studio, Visual Studio code and all other .NET development environments under the name Aumerial.Data.NTi. Once the package has been referenced and downloaded (approx. 400KB), NTi is up and running and ready to use.
IBM I SIDE
Prerequisites
On the IBM i side, it is obviously necessary to have valid login credentials and to have the required TCP services enabled (see General information on login). Otherwise, no special configuration or installation other than setting up a license key (see below) is required on the IBM i.
License key
A license key is required to use NTi, and is added by default to a dedicated NTi library called KNTI. Creating this library and adding the license key takes just a few minutes, preferably via the integrated NTi command-line interface. This license key is supplied to the user on startup of a 30-day trial version (free of charge) or on each renewal of a 1-year period (€3,000 excl. VAT). Each license key gives access to a single IBM i partition (identified by serial number and partition ID) for a limited time.
CONCLUSION
By offering direct, high-performance access to the IBM i, NTi has positioned itself as the essential solution for accessing the IBM i from .NET. All IBM i resources become accessible from any environment: Linux on Power, Mono on IBM i, Docker on ARM... deployment limits are overcome, and the benefits are numerous. Developers find life easier, IT departments no longer have to manage an infrastructure dedicated to ODBC applications, and end-users enjoy an enhanced user experience. Finally, NTi is quick and easy to implement. In just a few minutes, an application developed for ODBC or iDB2 can be migrated and fully exploited with NTi.