The following example reads records from a table one at a time into primitive JavaScript objects:
var c1 = pjs.allocStmt(); pjs.executeDirect(c1, "select prid, prname, prdesc from demolib/productsp order by prid"); if (SQLSTATE == '00000') { var obj = c1.fetch(); while (c1.hasMoreRows()) { console.log(obj); obj = c1.fetch(); } } pjs.close(c1);