Error connecting to Hive using JayDeBeApi - Class not found - java

I am trying to connect to my Hive server using JDBC connection.
I've the following JAR file in my JAVA_HOME:
HIVEJDBC41.jar
hadoop-common.jar
But when I run my code jaydebeapi.connect('org.apache.hive.jdbc.HiveDriver', url)
It gives me the following error:
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class org.apache.hive.jdbc.HiveDriver not found
Note: My connection needs to be using JDBC connection.
Anyone knows what I am missing?

There is mismatch of JDBC jar version
try hive-jdbc 2.3.7

Related

When does following error occurs "org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory"

I am trying to connect to oracle DB from linux which gives me following exception:
Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory
But for same connection string and driver version I am able to connect Oracle from windows.
It was a problem with an ojdbc6.jar driver. I changed it to ojdbc14.jar it worked fine for me.
Oracle's official site shows ojdbc6.jar as the latest driver for oracle11g which doesn't work for me on Linux platform.
You can download Ojdbc14.jar from the following link
http://www.oracle.com/technetwork/apps-tech/jdbc-10201-088211.html

HSQL SQLTool cant connect

I get the following:
java -jar ./sqltool/sqltool.jar inlineRc=url=jdbc:hsqldb:hsql://192.168.99.100/test,user=sa
Please enter password for sa!:
SqlTool v. 5337.
Can't connect to jdbc:hsqldb:hsql://192.168.99.100/test for user "org.hsqldb.jdbc.JDBCDriver"!
Reason: org.hsqldb.jdbc.JDBCDriver
I am using sqltool.jar in version 2.3.3. Anybody got a workaround or explaination?
Running SQLTool in this manner requires the hsqldb.jar to be in the same directory as the sqltool.jar.
The error message indicates it cannot find the HSQLDB's JDBC driver, which is in the hsqldb.jar.

MySQL not found on Mac, problems with eclipse project using mysql-connector-java-5.1.13-bin.jar

I have the following problem:
I imported an existing project into eclipse. This project references the library mysql-connector-java-5.1.13-bin.jar.
When I try to run the project I get the following errors:
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Warning, not in CLASSPATH?
Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
So I tried to find out if mySQL is installed by using the terminal: type -a mysql command. Result: type: mysql: not found
Now I downloaded and installed mysql. It is listed in /usr/local/ now. But the command: type -a mysql still shows the same result and the java application produces the same errors.
What do I have to do?
You need to check that mysql process is running...
$ ps ax | grep mysql
... and that mysql driver jar is really in your project class path (library).

JMeter jdbc:mysql error

I am trying to setup a JMeter server/client instance on a remote database server. I have extracted JMeter on the server, copied the MySQL java connector into $JMETER_HOME/lib and started the JMeter-server listener. On the client (my local desktop), I have pointed the JMeterclient to the remote server (via the remote_hosts entry in $JMETER_HOME/bin/jmeter.properties). Whenever I try to run a MySQL load job on the client (Run -> Remote Start -> ), I get the following error:
Response message: java.sql.SQLException: No suitable driver found for jdbc:mysql://1.2.3.4/database
And this is on the server side:
2013/04/10 12:44:43 WARN - jmeter.protocol.jdbc.config.DataSourceElement: Could not return Connection java.sql.SQLException: No suitable driver found for jdbc:mysql://1.2.3.4/dbname at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(DriverManager.java:185) at org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.newInstance(JdbcConnectionFactory.java:185) at org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLimitingPool.java:672) at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.newPoolable(ValidatedResourceLimitingPool.java:178) at org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.newPoolable(ResourceLimitingJdbcConnectionPool.java:123) at org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPool.java:402) at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get(ValidatedResourceLimitingPool.java:130) at org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.getConnection(ResourceLimitingJdbcDataSource.java:222) at org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:286) at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:146) at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:85) at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) at java.lang.Thread.run(Thread.java:662)
Does anyone have any idea why this wouldn't work even though the Java connector is in the jmeter lib dir?
So it turns out that the Percona MySQL version that we are running required a specific version of the connector. Dropped that in and it all worked out.

JMeter JDBC Response message: java.sql.SQLException: No suitable driver found for jdbc:oracle:

When I connect the database with JDBC i get this:
[StatAggResultCollector] Test Started, host: *local*
[StatAggResultCollector] Test Ended, host: *local*
in response message I get:
java.sql.SQLException: No suitable driver found for jdbc:oracle:..
Any solution?
Is this from jdbc driver or from configuration?
Looks like JMeter cannot find the Oracle driver.
Have you put the ojdbc14.jar or classes12.zip (which contains Oracle drivers) file in the JMETER/lib directory
For Oracle database 9 and 10 use ojdbc14.jar for Oracle database 11 use ojdbc5.jar if you use java 1.5 or ojdbc6.jar if you use java 1.6. Check java version in jmeter.bat file.

Categories

Resources