Oracle Magazine, Nov/Dec 2017
Database Developer OPEN SOURCE To use promises to execute a query first obtain a connection to the database then use the connection to execute the query and finally close the connection Each step is an asynchronous operation that must include error handling logic All the asynchronous methods of the driver have been configured to return a promise if the last parameter passed in is not a callback function This makes it easy to choose the pattern you prefer ORACLE MAGAZINE NOVEMBER OCTOBER 2017 57 const oracledb require oracledb const dbConfig user hr password oracle connectString localhost 1521 orcl let conn Declared here for scoping purposes oracledb getConnection dbConfig then function c console log Connected to database conn c return conn execute select from employees no binds
You must have JavaScript enabled to view digital editions.