// 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 to perform a SELECT myConn.beginTransaction(); var currRow1 = myConn.cursor('SELECT areacode,phone FROM employees WHERE uid >= 100'); var currRow2 = myConn.cursor('SELECT * FROM employees WHERE uid >= 100'); // Writes 'areacode', from the first cursor, to the page write(currRow1.columnName(0)); // Writes 'phone', from the first cursor, to the page write(currRow1.columnName(1)); // Writes all column names stored in the second cursor to the page. // This will include 'areacode' and 'phone' as well as any other // columns. for(var i = 0; i <= currRow2.columns(); i++){ write(currRow2.columnName(i)); } // Close the cursors currRow1.close(); currRow2.close(); // If the connection fails, write an error message }else{ write('Error (' + myConn.majorErrorCode() + '): ' + myConn.majorErrorMessage); } // Release the connection myConn.release();