jshs2 icon indicating copy to clipboard operation
jshs2 copied to clipboard

Not able to connect to db

Open Kiran-Shinde opened this issue 6 years ago • 3 comments

I am using node 6.1.0 And jshs2 0.4.4

And here is my code

` var serverConf = require("jshs2");

var Configuration = serverConf.Configuration;
var HiveConnection = serverConf.HiveConnection;
var IDLContainer = serverConf.IDLContainer;

var options = {
"auth": 'NOSASL',
"host": 'myserver',
"port": 10000,
"timeout": 100,
"username": 'abc',
"password": 'abc'
}

 const hiveConfig = new Configuration(options);
 const idl = new IDLContainer();


 function main() {
   idl.initialize(hiveConfig).then(function(data) {
	     var connection = new HiveConnection(hiveConfig, idl);
	    var cursor = connection.connect().then(function() {
		  console.log("success");
		// var res = cursor.execute('SELECT * FROM employees LIMIT 10');

		// if (res.hasResultSet) {
		// 	cursor.fetchBlock().then(function(fetchResult) {
		// 		for (var i = 0; i < fetchResult.rows.length; i++) {
		// 			console.log(fetchResult.rows[i])
		// 		}
		// 	})
		// }

		// cursor.close();
		// connection.close();
	     }, function() {
		     console.log("error");
	     });
	
	
  })


}

main();`

All I am getting in console is either 'error' or nothing. Any idea what will be the problem?

Kiran-Shinde avatar Apr 27 '18 06:04 Kiran-Shinde

same problem. is there any solution to solved this please?

y0uzha avatar May 17 '18 02:05 y0uzha

same problem here...

MrLugh avatar Nov 20 '19 03:11 MrLugh

It seems the library is abandoned. Please, try this one hive-driver, it should work better.

lenchv avatar Feb 21 '20 21:02 lenchv