A wrapper that uses jt400 in node.js. IBM i (AS400) that can be connected with jt400 seems to work.
IBM i:V5R4 Development PC: Windows10Pro 64bit node.js:6.9.1 npm:3.10.9 java:1.8.0_71 node-jt400:1.4.1
I built it by referring to This procedure. If you don't do these, you'll get a build error with npm install. (In addition, I was able to install npm smoothly on a Mac.)
mkdir myfolder
cd myfolder
npm init -y
npm install node-jt400
npm install express
For reference, it is a module installed by node-jt400.
-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| +-- [email protected]
| `-- [email protected]
`-- [email protected]
express is only used to make it easier to check the operation, and has nothing to do with the main story. This completes the development environment on the PC side.
Physical files and test data used in the test
MYLIB/MEMBER.PF
*****************************************************************
*File ID: MEMBER
*****************************************************************
A R MEMBERR TEXT('member')
*
A ID 3S 0 COLHDG(' ID ')
A LNAME 12J COLHDG('Last name')
A FNAME 6G COLHDG('name')
A PROF 40O COLHDG('profile')
A TOKUTEN 7P 3 COLHDG('score')
INSERT INTO MYLIB.MEMBER VALUES(100,'Chinese characters','Taro','Chinese charactersのみ',1000);
INSERT INTO MYLIB.MEMBER VALUES(101,'Half size','Kana','Ai Woo',50.555);
INSERT INTO MYLIB.MEMBER VALUES(102,'Alphabet','Lowercase','abcDEF!',-100);
INSERT INTO MYLIB.MEMBER VALUES(103,'Special','letter','① Taka Co., Ltd. IV ~',.01);
INSERT INTO MYLIB.MEMBER VALUES(104,'Chinese characters','Mixed','aiu',-15.25);
The CCSID of the IBM i sign-on user is 5035, and the physical file is also created at 5035.
It's quite interesting to be able to connect with a node without introducing Open Source Technologies (5733-OPS).
Recommended Posts