Yui-Wah Lee created HIVE-18082:
----------------------------------
Summary: HiveConnection is throwing an exception upon
getHoldability()
Key: HIVE-18082
URL: https://issues.apache.org/jira/browse/HIVE-18082
Project: Hive
Issue Type: Bug
Components: JDBC
Affects Versions: 1.2.1
Reporter: Yui-Wah Lee
I was trying to use C3P0 (com.mchange.v2.c3p0.ComboPooledDataSource) with
HiveDriver (org.apache.hive.jdbc.HiveDriver). I got an exception of this:
{code:java}
java.sql.SQLException: Method not supported
at org.apache.hive.jdbc.HiveConnection.getHoldability(HiveConnection.java:924)
at
com.mchange.v2.c3p0.impl.NewPooledConnection.<init>(NewPooledConnection.java:106)
at
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:159)
{code}
I found the source code of HiveConnection
([here|https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java])
{code:java}
/*
* (non-Javadoc)
*
* @see java.sql.Connection#getHoldability()
*/
@Override
public int getHoldability() throws SQLException {
// TODO Auto-generated method stub
throw new SQLFeatureNotSupportedException("Method not supported");
}
{code}
I think the method should return either one of these instead:
{code:java}
ResultSet.HOLD_CURSORS_OVER_COMMIT
ResultSet.CLOSE_CURSORS_AT_COMMIT
{code}
See also this [StackOverfow
article|https://stackoverflow.com/questions/47312944/why-does-not-hiveconnection-support-getholdability-using-c3p0-with-hivedriver?noredirect=1#comment81605411_47312944]
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)