AS400 integration may be done via:

  • ILE features
  • RUNJAVA
  • RUNQSH CL
  • RUNRMTCMD/REXEC

PHP/QSHELL

PHP call RPG: as400_php

RPG call PHP script:

  1. via webservice GET as400_rpg
  2. via call CL o exec
 
STRQSH QSH CMD('/usr/local/Zend/Core/bin/php-cli /www/zendsvr/htdocs/script1.php')
 
PGM
CD DIR('/www/zendcore/htdocs/TEST/')
STRQSH CMD('/usr/local/zend/core/bin/php + script1.php')
ENDPGM

PHP

as400_php

Java

RPG call java:

Java call RPG :

  • Access the integrated file system (IFS).
  • Run commands.
  • Call programs

su iSeries V5R8

/QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar

run a query:

DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
conn = DriverManager.getConnection("jdbc:as400://host_IP;naming=system;libraries=lib_A,lib_B,lib_C")
stmt = connection.createStatement();
rs = stmt.executeQuery("select * from file");
while (rs.next()) {
    String field1 = rs.getString(1);
}

run a command with jt400.jar:

import java.beans.PropertyVetoException;
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400Message;
import com.ibm.as400.access.CommandCall;
    AS400 as400 = new AS400("MySystem", "myUser", "myPassword");
    try {
        as400.setGuiAvailable(false);
    } catch (PropertyVetoException e) {
        log(e);
    }
    CommandCall cc = new CommandCall(as400);
    try {
        boolean isSuccessful = cc.run("CRTLIB FRED");
        outputPrintStream.println("Success? "+isSuccessful);
        // getMessageList returns an array of AS400Message objects
        for(AS400Message msg : cc.getMessageList()){
            outputPrintStream.println("  msg: "+msg.getID() +": "+msg.getText());
        }
    } catch (Exception e) {
        log(e);
    }

RPC

RUNRMTCMD CMD('ls; cat myfile; date') RMTLOCNAME(('9.5.1.94' *IP))

WebServices

  • usa api per aprire una connessione web da as400 al webservice remoto
  • usa php, java o cgidev per esporre un webservices

Database

  • espone i programmi come stored procedures
  • db2
  • unixodbc

Mqueue

  • espone una coda e programmi che reagiscono agli eventi

Notice: Undefined variable: browserName in /var/www/taziomirandola.it/lib/Visitors.php on line 86

Notice: Undefined variable: browserName in /var/www/taziomirandola.it/lib/Visitors.php on line 96

Deprecated: strripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /var/www/taziomirandola.it/lib/Visitors.php on line 96

Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /var/www/taziomirandola.it/lib/Visitors.php on line 39

Fatal error: Uncaught TypeError: Argument 1 passed to safe_text() must be of the type string, null given, called in /var/www/taziomirandola.it/lib/Visitors.php on line 39 and defined in /var/www/taziomirandola.it/lib/Visitors.php:162 Stack trace: #0 /var/www/taziomirandola.it/lib/Visitors.php(39): safe_text() #1 /var/www/taziomirandola.it/lib/Visitors.php(124): Visitors::getData() #2 [internal function]: Visitors::log() #3 {main} thrown in /var/www/taziomirandola.it/lib/Visitors.php on line 162