Connecting Tech Pros Worldwide Forums | Help | Site Map

PCML and DEXA

souporpower@gmail.com
Guest
 
Posts: n/a
#1: Oct 29 '08
Hi All

I have searched for PCML and DB2 and didn't find the relavant info.

I have some PCML files with data conversion between DB2 and JDBC. How
do I make a dexa call? I know how to call stored procedures in Java. I
am new to DEXA call. Can someone please clarify?

Thanks

souporpower@gmail.com
Guest
 
Posts: n/a
#2: Nov 14 '08

re: PCML and DEXA


On Oct 29, 8:21*am, "souporpo...@gmail.com" <soup_or_po...@yahoo.com>
wrote:
Quote:
Hi All
>
I have searched for PCML and DB2 and didn't find the relavant info.
>
I have some PCML files with data conversion between DB2 and JDBC. How
do I make a dexa call? I know how to call stored procedures in Java. I
am new to DEXA call. Can someone please clarify?
>
Thanks
Anyone know? Also how do I exchange XML with backend?
Thanks
souporpower@gmail.com
Guest
 
Posts: n/a
#3: Nov 14 '08

re: PCML and DEXA


On Nov 14, 2:49*pm, "souporpo...@gmail.com" <soup_or_po...@yahoo.com>
wrote:
Quote:
On Oct 29, 8:21*am, "souporpo...@gmail.com" <soup_or_po...@yahoo.com>
wrote:
>
Quote:
Hi All
>
Quote:
I have searched for PCML and DB2 and didn't find the relavant info.
>
Quote:
I have some PCML files with data conversion between DB2 and JDBC. How
do I make a dexa call? I know how to call stored procedures in Java. I
am new to DEXA call. Can someone please clarify?
>
Quote:
Thanks
>
Anyone know? Also how do I exchange XML with backend?
Thanks
I have a rudimentary understanding of PCML. How do I access the return
values from DB2. Please don't tell me about redbook. :)

This is the few steps that I have done successfully.

1. Create a PCML (Program Call Markup Language)

<pcml version="1.0">
<program name="JG" path="/QSYS.LIB/LMLIB/LIB/JFOONG.PGM">
<data name="name" type="char" usage="input" />
<data name="division" type="char" usage="input" />
</program>
</pcml>

2. Create a RPG program (This one you must trust me that it's running
fine. because i have tested it in the AS400 command line.)

3. Code my JavaBean and compiled it. And I got zero error or
exception.



import com.ibm.as400.data.*;
import com.ibm.as400.access.*;
import java.lang.*;
import java.io.*;
import java.util.*;

public class testjava {

/**
* TestCallRpg constructor.
*/

public testjava() { }

/**
* This program is written as an application
* to easily demonstrate calling an RPG program
* and run the program from your development environment.
*/
public void header() {

/* Create a connection the iSeries where the program you wish to call
resides */
AS400 sys = new AS400("AS400_name","username","password");
if(sys == null){
System.out.println("Connection failed");
System.exit(1);
} else {
System.out.println("Manage to connect to AS400");
}


ProgramCallDocument pcml;
try{
pcml = new ProgramCallDocument(sys, "Test"); // open the
PCML File
// set all the input parameters for program alias DateCalc
pcml.setValue("JFOONG.name", "abc");
pcml.setValue("JFOONG.division", "def");
// call the program
boolean rc = pcml.callProgram("JG");
if(rc == false){
System.out.println("Program failed");
}else{
System.out.println("Program OK");
}
}catch(PcmlException pe){
System.out.println(" Caught Exception ");
pe.printStackTrace();
}finally{
System.exit(0);
}

}

}

4. Code my JSP page to call this JavaBean.

<%@ page language="java" import="java.sql.*, java.io.*, java.util.*,
com.wrox.cars.* "
%>
<jsp:useBean id="person" class="com.wrox.cars.testjava" />
<html>

<body>
<%
person.header();
%>
</body>
</html>

5. Make sure that my IBM WebSphere Application class path will include
in my com.ibm.as400 JAR file.

*

Question is how do I access the return values?
souporpower@gmail.com
Guest
 
Posts: n/a
#4: Nov 14 '08

re: PCML and DEXA


On Nov 14, 3:30*pm, "souporpo...@gmail.com" <soup_or_po...@yahoo.com>
wrote:
Quote:
On Nov 14, 2:49*pm, "souporpo...@gmail.com" <soup_or_po...@yahoo.com>
wrote:
>
Quote:
On Oct 29, 8:21*am, "souporpo...@gmail.com" <soup_or_po...@yahoo.com>
wrote:
>
Quote:
Quote:
Hi All
>
Quote:
Quote:
I have searched for PCML and DB2 and didn't find the relavant info.
>
Quote:
Quote:
I have some PCML files with data conversion between DB2 and JDBC. How
do I make a dexa call? I know how to call stored procedures in Java. I
am new to DEXA call. Can someone please clarify?
>
Quote:
Quote:
Thanks
>
Quote:
Anyone know? Also how do I exchange XML with backend?
Thanks
>
I have a rudimentary understanding of PCML. How do I access the return
values from DB2. Please don't tell me about redbook. :)
>
This is the few steps that I have done successfully.
>
1. Create a PCML (Program Call Markup Language)
>
<pcml version="1.0">
<program name="JG" path="/QSYS.LIB/LMLIB/LIB/JFOONG.PGM">
<data name="name" type="char" usage="input" />
<data name="division" type="char" usage="input" />
</program>
</pcml>
>
2. Create a RPG program (This one you must trust me that it's running
fine. *because i have tested it in the AS400 command line.)
>
3. Code my JavaBean and compiled it. And I got zero error or
exception.
>
import com.ibm.as400.data.*;
import com.ibm.as400.access.*;
import java.lang.*;
import java.io.*;
import java.util.*;
>
public class testjava {
>
/**
* TestCallRpg constructor.
*/
>
public testjava() { }
>
/**
* This program is written as an application
* to easily demonstrate calling an RPG program
* and run the program from your development environment.
*/
public void header() {
>
/* Create a connection the iSeries where the program you wish to call
resides */
* * * AS400 sys = new AS400("AS400_name","username","password");
* * * if(sys == null){
* * * * * * System.out.println("Connection failed");
* * * * * * System.exit(1);
* * * } else {
* * * * * * System.out.println("Manage to connect to AS400");
* * * }
>
* * * ProgramCallDocument pcml;
* * * try{
* * * * * * pcml = new ProgramCallDocument(sys, "Test"); //open the
PCML File
* * * * * * // set all the input parameters for program aliasDateCalc
* * * * * * pcml.setValue("JFOONG.name", "abc");
* * * * * * pcml.setValue("JFOONG.division", "def");
* * * * * * // call the program
* * * * * * boolean rc = pcml.callProgram("JG");
* * * * * * if(rc == false){
* * * * * * * * * System.out.println("Program failed");
* * * * * * }else{
* * * * * * * * * System.out.println("Program OK");
* * * * * * }
* * * }catch(PcmlException pe){
* * * * * * System.out.println(" Caught Exception ");
* * * * * * pe.printStackTrace();
* * * * * * }finally{
* * * * * * * * * System.exit(0);
* * * * * * * * * }
>
* * * }
>
}
>
4. Code my JSP page to call this JavaBean.
>
<%@ page language="java" import="java.sql.*, java.io.*, java.util.*,
com.wrox.cars.* "
%>
<jsp:useBean id="person" class="com.wrox.cars.testjava" />
<html>
>
<body>
<%
person.header();
%>
</body>
</html>
>
5. Make sure that my IBM WebSphere Application class path will include
in my com.ibm.as400 JAR file.
>
*
>
Question is how do I access the return values?
If anyone is reading, here is a good link that explains PCML

http://publib.boulder.ibm.com/iserie...h/pcmlproc.htm


Closed Thread


Similar DB2 Database bytes