title: Node access multiple databases
body: <p>I want to connect to different databases on server side so I can perform queries that include those two databases using node.</p>
  
  <p>I have a <code>config.js</code> like this:</p>
  
  <pre><code>module.exports = {
      database: {
          user: 'brunojs',
          password: 'bdpf5',
          connectString: 'localhost:1521/orcl'
      },
      jwtSecretKey: "jmvhDdDBMvqb=M@6h&amp;QVA7x"
  };
  </code></pre>
  
  <p>This saves my info for accessing the first database.</p>
  
  <p>Then I have one <code>list.js</code> file which performs the query:</p>
  
  <pre><code>var oracledb = require('oracledb');
  var jwt = require('jsonwebtoken');
  var config = require(__dirname + '../../config.js');
  
  function get(req, res, next) {
      oracledb.getConnection(
          config.database,
          function(err, connection){
              if (err) {
                  return next(err);
              }
  
              connection.execute(
                  'select num_sequencial, notes, des_especialidade, dt_diag ' +
                  'from organite_repository ',
                  {},//no binds
                  {
                      outFormat: oracledb.OBJECT
                  },
                  function(err, results){
                      if (err) {
                          connection.release(function(err) {
                              if (err) {
                                  console.error(err.message);
                              }
                          });
  
                          return next(err);
                      }
  
                      res.status(200).json(results.rows);
  
                      connection.release(function(err) {
                          if (err) {
                              console.error(err.message);
                          }
                      });
                  }
              );
          }
      );
  }
  
  module.exports.get = get;
  </code></pre>
  
  <p>Everything works fine. </p>
  
  <p>The thing is, right now, I want to perform queries using another database. How can I do that?</p>