// Create a pool of connections var myPool = new DbPool("ORACLE", "mySID", "myApp", "appsPWD", "myTNS"); // Open a connection from the pool. Give error if connection could // not be made. var myConn = myPool.connection('Employees', 15); if(myConn.connected()){ // Start a new SQL transaction myConn.beginTransaction(); // Run the stored procedure var myStproc = myConn.storedProc("sp_employees"); // Store the result sets var myResultSet1 = myStproc.resultSet(); var myResultSet2 = myStproc.resultSet(); // Writes column #1, from the first result set, to the page write(myResultSet1.columnName(0)); // Writes column #1, from the first result set, to the page write(myResultSet1.columnName(1)); // Writes all column names stored in the second resultset to the page. for(var i = 0; i <= myResultSet2.columns(); i++){ write(myResultSet2.columnName(i)); } // Close the result sets myResultSet1.close(); myResultSet2.close(); // End SQL transaction myConn.commitTransaction(); // If the connection fails, write an error message }else{ write('Error (' + myConn.majorErrorCode() + '): ' + myConn.majorErrorMessage); } // Release the connection myConn.release();