const sql = require("msnodesqlv8");
const connectionString ="server=SELT063;Database=AuthDB;username=sa;password=sa;Trusted_Connection=Yes;Driver={SQL Server Native Client 11.0};pool:{max:100,min:1}";
sql.open(connectionString, function (err, conn) {
if(err){
console.log("Error while connecting to DB :: "+err);
}
var pm = conn.procedureMgr();
pm.setTimeout(2);
sqlParams=[
{
"name": "Name",
"type": "sql.varchar",
"value": "ans"
},{
"name": "mob",
"type": "sql.varchar",
"value": "96"
}];
pm.callproc('GetUser',[sqlParams[0].value,sqlParams[1].value], function(err,
results) {
if(err){
console.log("Error in executing procedure :: "+err);
}
else{
console.log('Procedure call success');
console.log(results);
}
});
})
我想使用msnodesqlv8节点包创建一个连接池。但是我不知道该怎么做。我已经在上面发布了代码。