javascript - Unable to Connect to MSSQL from NODEJS with SSL -
i trying connect sql server database using node.js
below code :
var express = require('express'); var sql = require('mssql'); var app = express(); app.get('/', function (req, res) { var config = { server: 'server', database: 'database', user: 'user', password: 'password', options: { encrypt: true, trustservercertificate:false } }; sql.connect(config, function (err) { if (err) console.log(err); var request = new sql.request(); console.log("preparing request"); request.query("some query").then(function (recordset) { if (err) console.log(err); res.send(recordset); }); }); }); app.listen(8080);
i log: "preparing request". after nothing happens. there isn't error log either.
in java connect db using following url: jdbc:jtds:sqlserver://servername;ssl=request
Comments
Post a Comment