Support Questions
Find answers, ask questions, and share your expertise
Alert: Please see the Cloudera blog for information on the Cloudera Response to CVE-2021-4428

Does JAVA Prepared statement for Insert work in Hive - m using Cloudera Quickstart VM 5.4.2

New Contributor

can I upgrade Hive 1.1 to 1.4 in Cloudera Quickstart VM - default version is 1.1

Using Spring batch, I am trying to read an XML file and Insert into Hive - i get error message saying "Prepared statement  - method not supported" for Insert into sql.

I doubt if it has to do with version 1.1 and need to try it out with latest version 1.4.





Yea the prepared statements are not supported in hive in any of the versions (there is no Hive 1.4 by the way).


The normal workflow is to run 'load data' statements to get your data into hive warehouse.

New Contributor

Thanks for your reply - when I run a plain java program using Main class (like creating a connection, have the Insert query defined and use preparedstatementobject.executeUpdate(),

it works fine - the data is getting inserted into Hive.


When I do the same through Spring batch using databaseItemWriter in an XML file, I face this issue saying


PreparedStatementCallback; uncategorized SQLException for SQL [  whatever the Hive sql statements I provide here    ]; SQL state [null]; error code [0]; Method not supported; nested exception is java.sql.SQLException: Method not supported]




Do you recommend any way to write data from an XML file to HIVE - as I was trying to implement through Spring batch. Just want to know if there is any better alternative - Thanks.