How to use the jdbc/lib/jinst.addOption function in jdbc

To help you get started, we’ve selected a few jdbc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feup-infolab / dendro / src / kb / db / db_jdbc.js View on Github external
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,
github feup-infolab / dendro / src / kb / db.js View on Github external
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,
github feup-infolab / dendro / src / kb / db-adapters / virtuoso.js View on Github external
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: {}
github gaiandb / gaiandb / node-red-node-gaiandb / src / gaiandb.js View on Github external
// 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) {
github biblibre / urungi / server / core / legacy / jdbc-oracle.js View on Github external
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);
github cube-js / cube.js / packages / cubejs-jdbc-driver / driver / JDBCDriver.js View on Github external
mvnPromise = mvn().then((mvnResults) => {
      if (!jinst.isJvmCreated()) {
        jinst.addOption("-Xrs");
        const classPath = mvnResults.classpath.concat(customClassPath || []);
        jinst.setupClasspath(classPath);
      }
    });
  }