Beispiel #1
0
 return jdbcHelper.prepareJdbcPaths().then(function (paths) {
   if (!jinst.isJvmCreated()) {
     // TODO: add new feature to pass java options as well
     // https://github.com/sirensolutions/kibi-private/issues/176
     // jinst.addOption("-Xrs");
     jinst.setupClasspath(paths.libs);
     return true;
   }
   return Promise.reject(new Error('Jvm not created'));
 });
Beispiel #2
0
function PhoenixPlugin(acquisitor, config) {
  // Plugin name
  this.name = 'phoenix';
  // Plugin needs its acquisitor parent
  this.acquisitor = acquisitor;
  // isConnected true if the plugin is in use
  this.isConnected = false;
  this.config = config;
  this.queryClient = null;

  if (!jinst.isJvmCreated()) {
    jinst.addOption("-Xrs");
    jinst.setupClasspath(this.config.java.libPath);
  }

  this.connection = new Pool(this.config.jdbc);
};
Beispiel #3
0
//this setup the main js module
var JDBC = require('jdbc');
var javaVm = require('jdbc/lib/jinst'); 
var dbSpec = require ("../config/db.json"); //read and get json properties file
var dbConn = null;
var myexport = module.exports = {}; //make fuction avaiable to external files

console.log('start init...');

javaVm.addOption("-Xrs");
javaVm.setupClasspath(['./drivers/derby.jar','./drivers/derbyclient.jar','./drivers/derbytools.jar']);

//export public variable
myexport.isConnected = false;
myexport.DbHandler = null;

//this return a connection object
//-----------------------------------------
myexport.InitDerby = function  () { 

	//create JDBC connection object
	var l_Handler = new JDBC({
		url: 'jdbc:derby://' + dbSpec.host + ':' + dbSpec.port + '/' + dbSpec.dbpath + ';user=cat;password=cat',
		drivername: 'org.apache.derby.jdbc.ClientDriver',
		user : dbSpec.username,
		password : dbSpec.password,
		minpoolsize: dbSpec.minpool,
		maxpoolsize: dbSpec.maxpool
	});

	l_Handler.initialize(function(err) {