IBM Power Systems AS/400 iSeries ¤Ë´Ø¤¹¤ë³Ð¤¨½ñ¤­¤Ê¥Ú¡¼¥¸¤Ç¤¹¡£

JSP¤«¤éRPG¤Î¥µ¥Ö¥ë¡¼¥Á¥ó¤ò¸Æ¤Ó½Ð¤¹

¤«¤ó¤¿¤ó¤ÊRPG¤Î¥µ¥ó¥×¥ë¤Ë¤Æ»ÈÍѤ·¤¿RPG¤Î¥µ¥Ö¥ë¡¼¥Á¥ó¤òJSP¤«¤é¸Æ¤Ó½Ð¤¹¥µ¥ó¥×¥ë¤Ç¤¹¡£
¼Â¹Ô¥Ú¡¼¥¸(as20.jsp)¤È¼Â¹Ô·ë²Ìɽ¼¨¥Ú¡¼¥¸(as21.jsp)¤Ç¤¹¡£
pcml¥Õ¥¡¥¤¥ë¤âÍÑ°Õ¤·¤ÆWEB-INF/src¤ËÇÛÃÖ¤·¤Æ¤¯¤À¤µ¤¤¡£
as20.jsp
<%@ page language="java" contentType="text/html; charset=windows-31j"
    pageEncoding="windows-31j"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>AS400¤Î¥µ¥Ö¥ë¡¼¥Á¥ó¤ò¼Â¹Ô</title>
</head>
<body>
AS/400¤Î¥µ¥Ö¥ë¡¼¥Á¥ó(PRIMULA/SAMPLE02)¤ò¼Â¹Ô¤·¤Þ¤¹<BR>
ÆþÎϥѥé¥á¡¼¥¿£±:PACK 20,2¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤<BR>
<form action=as21.jsp method=POST>
<input type=text size=30 name=PramIn1>
<input type=submit value="¼Â¹Ô" name=btn1>
</form>
</body>
</html>
as21.jsp
<%@ page language="java" contentType="text/html; charset=windows-31j"
    pageEncoding="windows-31j" import="com.ibm.as400.access.*,com.ibm.as400.data.*,java.math.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>¥µ¥Ö¥ë¡¼¥Á¥ó¤Î¼Â¹Ô·ë²Ì</title>
</head>
<body>
<h2>¥µ¥Ö¥ë¡¼¥Á¥ó(LICORICE/SAMPLE01)¤Î¼Â¹Ô·ë²Ì</h2>
<%
request.setCharacterEncoding("windows-31j");
try {
    AS400 as400 = new AS400("SHUFFLE","PRIMULA","NERINE");
    ProgramCallDocument testPCML = new ProgramCallDocument(as400,"SAMPLE01");
    // Æþ½ÐÎϤΥѥé¥á¡¼¥¿¤òºîÀ®
    BigDecimal in1 = new BigDecimal(request.getParameter("PramIn1"));
    BigDecimal out1 = new BigDecimal("0.00");
    // ¥Ñ¥é¥á¡¼¥¿¥»¥Ã¥È
    testPCML.setValue("SAMPLE01.IN1", in1);
    // ¼Â¹Ô
    if(testPCML.callProgram("SAMPLE01")) {
        out.println("SAMPLE01:¼Â¹Ô´°Î»<br>");
        out1 = (BigDecimal)testPCML.getValue("SAMPLE01.OUT1");
        out.println("ÆþÎÏÃÍ¡§"+ in1 + "<br>");
        out.println("Ìá¤êÃÍ¡§"+ out1 + "<br>");
    }
} catch (Exception ex) {
    ex.printStackTrace();
}
%>
</body>
</html>
¼Â¹Ô·ë²Ì

¥³¥á¥ó¥È¤ò¤«¤¯


¡Öhttp://¡×¤ò´Þ¤àÅê¹Æ¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

ÍøÍѵ¬Ìó¤ò¤´³Îǧ¤Î¤¦¤¨¤´µ­Æþ²¼¤µ¤¤

WikiÆ⸡º÷

Menu

¤³¤³¤Ï¼«Í³¤ËÊÔ½¸¤Ç¤­¤ë¥¨¥ê¥¢¤Ç¤¹¡£

¥á¥ó¥Ð¡¼¤Î¤ßÊÔ½¸¤Ç¤­¤Þ¤¹