How connect Firebird DB to Node.js app
I have Firebird 2.5 database.His FbServerType is Embedded. and I can not connect this DB to my node.js App. I use from connect this library https://github.com/sdnetwork/node-firebird
var Firebird = require('node-firebird');
var options = {};
options.host = '127.0.0.1';
options.port = 3030;
options.database = 'D:/proj/oh/node_modules/Firebird-2.5.9.27139-0_Win32_embed/WAREHOUSE.fdb';
options.user = 'SYSDBA';
options.password = 'masterkey';
options.lowercase_keys = false; // set to true to lowercase keys
options.role = null; // default
options.pageSize = 4096; // default when creating database
// 5 = the number is count of opened sockets
var pool = Firebird.pool(5, options);
// Get a free pool
pool.get(function(err, db) {
if (err)
throw err;
// db = DATABASE
db.query('SELECT * FROM CARRIER', function(err, result) {
// IMPORTANT: release the pool connection
db.detach();
});
});
// Destroy pool
pool.destroy();
and I have next error
D:\proj\a\server.js:21
throw err;
^
Error: connect ECONNREFUSED 127.0.0.1:3030
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1136:16) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 3030
}
Please, help me connect my DB to node application. Use of Node-firebird is optional but using require('firebird') like this
var fb = require("firebird");
var con = fb.createConnection();
con.connectSync('WAREHOUSE.FDB', 'SYSDBA', 'masterkey', '');
var rs = con.querySync('SELECT * FROM CARRIER');
so doesn`t work. I think probably Firebird 2.5 Embedded already not support new version Node.js(but this is just my guess).