You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "McWhorter, David" <Da...@PremierInc.com> on 2015/06/03 20:04:34 UTC

connection pooling for hive JDBC client

Hello, I am working on an application that queries and interacts with hive using the JDBC API.  In many other cases, using a JDBC connection pool such as commons-dbcp or BoneCP or HikariCP is a recommended practice and results in much better performance.  All of the examples I’ve found of using accessing Hive through the JDBC API (such as https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-JDBCClientSampleCode) use a raw JDBC connection to Hive directly.  A few questions:

  1.  Should hive work with connection pools such as commons-dbcp, BoneCP, or HikariCP?
     *   Note: I have tried all BoneCP and HikariCP, and cannot seem to get either to work because HiveConnection.setReadOnly throws a java.sql.SQLException saying “Method not supported”.  I am using hive 0.14.0.
  2.  Do you recommended using a JDBC connection pool for interacting with hive from an application that will execute many repeated and concurrent queries/statements?

Also, just to be clear, I am not asking about configuring the Hive metastore to use a connection pool to connect to its underlying database (MySQL, PostgreSQL, etc), but about using a connection pool to interact with and query Hive through the JDBC api from an application.

Thank you,
David McWhorter

—

David McWhorter
Senior Developer, Foundations
Informatics and Technology Services
Office: 434.260.5232 | Mobile: 434.227.2551
david_mcwhorter@premierinc.com<ma...@premierinc.com>  |  Premier, Inc. (NASDAQ: PINC)