1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| const oracledb = require('oracledb');
async function run() { const config = { user: '10000', password: '10000', connectString: '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST =111.111.111.111)(PORT = 10000))(CONNECT_DATA = (SID = ORCL)))' };
let connection; try { connection = await oracledb.getConnection(config);
const result = await connection.execute(`SELECT * FROM BD_JOB`); console.log(result); } catch (e) { } finally { if(connection) { try { await connection.close(); } catch (err) { } } } }
run();
|