Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const checkDatabaseConnection = function(callback)
{
const JDBC = require('jdbc');
const jinst = require('jdbc/lib/jinst');
if (!jinst.isJvmCreated()) {
jinst.addOption("-Xrs");
jinst.setupClasspath([
Pathfinder.absPathInApp("conf/virtuoso-jdbc/virtjdbc4.jar")
]);
}
const config = {
// Required
url : "jdbc:virtuoso://192.168.56.249:1111",
drivername: 'virtuoso.jdbc4.Driver',
minpoolsize: 1,
maxpoolsize: 100,
username: "dba",
password : "dba",
serverName : "192.168.56.249",
portNumber : 1111,
const checkDatabaseConnectionViaJDBC = function (callback)
{
Logger.log("debug", "Checking virtuoso connectivity via JDBC...");
if (!jinst.isJvmCreated())
{
jinst.addOption("-Xrs");
jinst.setupClasspath([
rlequire.absPathInApp("dendro", "conf/virtuoso-jdbc/jdbc-4.2/virtjdbc4_2.jar")
]);
}
// Working config in Dendro PRD, 22-12-2017
/*
const timeoutSecs = 10;
const config = {
// Required
url: `jdbc:virtuoso://${self.host}:${self.port_isql}/UID=${self.username}/PWD=${self.password}/PWDTYPE=cleartext/CHARSET=UTF-8/TIMEOUT=${timeoutSecs}`,
drivername: "virtuoso.jdbc4.Driver",
maxpoolsize: Math.ceil(self.maxSimultaneousConnections / 2),
minpoolsize: 1,
// 10 seconds idle time
maxidle: 1000 * timeoutSecs,
const checkDatabaseConnectionViaJDBC = function (callback)
{
if (!jinst.isJvmCreated())
{
jinst.addOption("-Xrs");
jinst.setupClasspath([
rlequire.absPathInApp("dendro", "conf/virtuoso-jdbc/jdbc-4.2/virtjdbc4_2.jar")
]);
}
// Working config in Dendro PRD, 22-12-2017
// const timeoutSecs = 10;
// const config = {
// // Required
// url: `jdbc:virtuoso://${self.host}:${self.port_isql}/UID=${self.username}/PWD=${self.password}/PWDTYPE=cleartext/CHARSET=UTF-8/TIMEOUT=${timeoutSecs}`,
// drivername: "virtuoso.jdbc4.Driver",
// maxpoolsize: Math.ceil(self.maxSimultaneousConnections / 2),
// minpoolsize: 1,
// // 10 seconds idle time
// maxidle: 1000 * timeoutSecs,
// properties: {}
// check that the jar file exists!
try {
var fs = require('fs');
fs.accessSync(path.join(__dirname,'jars','derbyclient.jar'), fs.F_OK);
// OK, no problem
} catch (e) {
// It isn't accessible, log an error and return
this.error ("derbyclient.jar file is missing - see node-red-node-gaiandb install documentation.");
return;
}
// add in the derby class jar into the jvm classpath.
if (!jinst.isJvmCreated()) {
jinst.addOption("-Xrs");
jinst.setupClasspath([path.join(__dirname,'jars','derbyclient.jar')]);
}
this.url = "jdbc:derby://"+this.hostname+":"+this.port+"/"+this.db+";user="+this.credentials.user+";password="+this.credentials.password;
// add on any ssl options to the connection url.
switch (this.ssl) {
case "basic":
this.url += ";ssl=basic";
break;
case "peer":
this.url += ";ssl=peerAuthentication";
break;
}
if (this.credentials && this.credentials.user && this.credentials.password) {
db.prototype.connect = function (data, done) {
var DB = this;
var JDBC = require('jdbc');
var jinst = require('jdbc/lib/jinst');
if (!jinst.isJvmCreated()) {
jinst.addOption('-Xrs');
jinst.setupClasspath(['./server/jdbc/oracle/ojdbc7.jar', './server/jdbc/oracle/orai18n.jar', './server/jdbc/oracle/xdb6.jar']);
}
var config = {
// SparkSQL configuration to your server
url: 'jdbc:oracle:thin:' + data.userName + '/' + data.password + '@' + data.host + ':' + data.port + '/' + data.database,
drivername: 'oracle.jdbc.OracleDriver',
minpoolsize: 1,
maxpoolsize: 100,
properties: {}
};
DB.datasourceID = data._id;
DB.connection = new JDBC(config);
const checkDatabaseConnection = function(callback)
{
const JDBC = require('jdbc');
const jinst = require('jdbc/lib/jinst');
if (!jinst.isJvmCreated()) {
jinst.addOption("-Xrs");
jinst.setupClasspath([
Pathfinder.absPathInApp("conf/virtuoso-jdbc/virtjdbc4.jar")
]);
}
const config = {
// Required
url : "jdbc:virtuoso://192.168.56.249:1111",
drivername: 'virtuoso.jdbc4.Driver',
minpoolsize: 1,
maxpoolsize: 100,
username: "dba",
password : "dba",
serverName : "192.168.56.249",
var jinst = require('jdbc/lib/jinst');
// check that the jar file exists!
try {
var fs = require('fs');
fs.accessSync(path.join(__dirname,'jars','derbyclient.jar'), fs.F_OK);
// OK, no problem
} catch (e) {
// It isn't accessible, log an error and return
this.error ("derbyclient.jar file is missing - see node-red-node-gaiandb install documentation.");
return;
}
// add in the derby class jar into the jvm classpath.
if (!jinst.isJvmCreated()) {
jinst.addOption("-Xrs");
jinst.setupClasspath([path.join(__dirname,'jars','derbyclient.jar')]);
}
this.url = "jdbc:derby://"+this.hostname+":"+this.port+"/"+this.db+";user="+this.credentials.user+";password="+this.credentials.password;
// add on any ssl options to the connection url.
switch (this.ssl) {
case "basic":
this.url += ";ssl=basic";
break;
case "peer":
this.url += ";ssl=peerAuthentication";
break;
}
db.prototype.connect = function (data, done) {
var DB = this;
var JDBC = require('jdbc');
var jinst = require('jdbc/lib/jinst');
if (!jinst.isJvmCreated()) {
jinst.addOption('-Xrs');
jinst.setupClasspath(['./server/jdbc/oracle/ojdbc7.jar', './server/jdbc/oracle/orai18n.jar', './server/jdbc/oracle/xdb6.jar']);
}
var config = {
// SparkSQL configuration to your server
url: 'jdbc:oracle:thin:' + data.userName + '/' + data.password + '@' + data.host + ':' + data.port + '/' + data.database,
drivername: 'oracle.jdbc.OracleDriver',
minpoolsize: 1,
maxpoolsize: 100,
properties: {}
};
DB.datasourceID = data._id;
DB.connection = new JDBC(config);
const checkDatabaseConnectionViaJDBC = function (callback)
{
Logger.log("debug", "Checking virtuoso connectivity via JDBC...");
if (!jinst.isJvmCreated())
{
jinst.addOption("-Xrs");
jinst.setupClasspath([
rlequire.absPathInApp("dendro", "conf/virtuoso-jdbc/jdbc-4.2/virtjdbc4_2.jar")
]);
}
// Working config in Dendro PRD, 22-12-2017
/*
const timeoutSecs = 10;
const config = {
// Required
url: `jdbc:virtuoso://${self.host}:${self.port_isql}/UID=${self.username}/PWD=${self.password}/PWDTYPE=cleartext/CHARSET=UTF-8/TIMEOUT=${timeoutSecs}`,
drivername: "virtuoso.jdbc4.Driver",
maxpoolsize: Math.ceil(self.maxSimultaneousConnections / 2),
minpoolsize: 1,
const checkDatabaseConnectionViaJDBC = function (callback)
{
if (!jinst.isJvmCreated())
{
jinst.addOption("-Xrs");
jinst.setupClasspath([
rlequire.absPathInApp("dendro", "conf/virtuoso-jdbc/jdbc-4.2/virtjdbc4_2.jar")
]);
}
// Working config in Dendro PRD, 22-12-2017
// const timeoutSecs = 10;
// const config = {
// // Required
// url: `jdbc:virtuoso://${self.host}:${self.port_isql}/UID=${self.username}/PWD=${self.password}/PWDTYPE=cleartext/CHARSET=UTF-8/TIMEOUT=${timeoutSecs}`,
// drivername: "virtuoso.jdbc4.Driver",
// maxpoolsize: Math.ceil(self.maxSimultaneousConnections / 2),
// minpoolsize: 1,
// // 10 seconds idle time