Getting error connectring to Hive.Error:java.sql.S

2020-04-30 11:20发布

问题:

Hi I am trying to connect to hive from Nodejs. I used https://www.npmjs.com/package/jdbc to install JDBC. I get the following error:

Error: Error running static method java.sql.SQLException: No suitable driver found for jdbc:hive2:

Here is my code:

var JDBC = require('jdbc');
var jinst = require('jdbc/lib/jinst');

if (!jinst.isJvmCreated()) {
  jinst.addOption("-Xrs");
  jinst.setupClasspath(['./drivers/hsqldb.jar',
                    './drivers/derby.jar',
                    './drivers/derbyclient.jar',
                    './drivers/derbytools.jar']);
}

 var jdbcconfig = {
 url: 'jdbc:hive2://hdprd1-edge-lb01:20000',
 user : 'user',
 password: 'password'
};

I am not sure which driver to mention, I know there is a config property called drivername but not sure which driver to use.

Any help would be greatly appreciated.