Support Questions

Find answers, ask questions, and share your expertise
Welcome to the upgraded Community! Read this blog to see What’s New!

How to update Driver Class for DBCPConnectionPool for NIFI - Hive

New Contributor

I am aware of PutHiveSQL processor , but want to use DBCPConnectionPool


Error :- 2017-11-30 11:26:05,569 ERROR [StandardProcessScheduler Thread-2] o.a.n.c.s.StandardControllerServiceNode DBCPConnectionPool[id=0160100a-8103-194b-50a7-ce556048b78e] Failed to invoke @OnEnabled method due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver: {} org.apache.nifi.reporting.InitializationException: Can't load Database Driver at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader( at org.apache.nifi.dbcp.DBCPConnectionPool.onConfigured( at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)


Super Guru

It is highly recommended to not put your JDBC driver JAR(s) in NiFi's lib/ directory, as they can disturb the behavior of the other components in the system. I recommend a separate path containing the driver JAR and all its dependencies in a flat directory. Also on Windows you may need to use the URL style "file://C/" or just "/" instead of "C:\" but I'm not sure about that part.

Another caveat with Hive drivers is that some (including the official Apache Hive JDBC driver that comes with NiFi's Hive bundle) do not support all JDBC methods, such as setQueryTimeout(), or have different mechanisms for getting at table metadata (from the ResultSetMetaData rather than DatabaseMetaData or vice versa) than what is used by ExecuteSQL. Those reasons are why there are SelectHiveQL and PutHiveQL processors, so the Hive driver could be included and the processors can perform any driver-specific functions/workarounds as necessary. So you may find that the SQL processors do not work with your Hive driver, but I am not familiar with that driver so I can't say for sure. If you see errors such as "Method not supported", then this usually indicates the scenario I'm talking about.