I have been trying hard to run an example using Hive ODBC but unsuccessful so far.
I am running my java program from Win64 using the Hive ODBC driver from Hortonworks. I am ending up with the below error consistently.
Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3907)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5698)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:354)
at sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(JdbcOdbcConnection.java:1503)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:381)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at inverika.training.hive.HiveODBCClient.main(HiveODBCClient.java:30)
What I gather from my search is that this is related to microsoft ODBC driver issue but did not find any suitable solution. Does any one have any idea about this issue? Appreciate if any one can provide pointers.
Alternately I want to try ODBC directly from my Linux VM. For thsi I need Hive ODBC for Linux Ubuntu. I am not good at compiling and generating the required libraries. If any one has done this before please share it.
Thanks for your help.
I'm not clear on your problem. Where do the error messages that you include come from? Are you using the JDBC driver or the ODBC driver?
Assuming that you're using HDP, the Linux ODBC drivers are available here:
http://hortonworks.com/download/download-archives/
Related
I try to add new Data Source in ODBC Administrator but I get an error:
Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed
The setup routines for the Oracle in OraClient11g_home1 ODBC driver could not be accessed. Please reinstall the driver.
Reinstalling Oracle does not help.
Other drivers (include stone-age "Microsoft ODBC for Oracle") work well. I can also use existing ODBC data sources I added earlier times, so the driver works well. I get the error only when I try to add a new data source or try to re-configure an existing one.
I found this solution https://serverfault.com/questions/555972/cannot-create-oracle-odbc-source-on-64bit-windows-7 but it does not help either.
I found the problem, it was caused by some manual edits in my Registry. It should be like this:
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Oracle in OraClient11g_home1]
"APILevel"="1"
"CPTimeout"="60"
"ConnectFunctions"="YYY"
"Driver"="C:\\oracle\\product\\11.2\\Client_x64\\bin\\sqora32.dll"
"DriverODBCVer"="03.51"
"FileUsage"="0"
"Setup"="C:\\oracle\\product\\11.2\\Client_x64\\bin\\sqoras32.dll"
"SQLLevel"="1"
DLL for Driver is "sqora32.dll" whereas DLL for Setup it is "sqoras32.dll"
I like understand the 'Hive ODBC Connector' concept. means What is a use of Hive ODBC Connector in the architecture.
Does it require to set-up the DSN (data source Name ). Can we go for DSN-less configuration ?
Please explain in details
If you have one of the distributions from Cloudera, Hortonworks, MapR, Intel, Microsoft or DataStax, they already come with an ODBC driver in the distribution. The driver is created by Simba Technologies (http://www.simba.com/connectors/apache-hadoop-hive-odbc).
If you're using the Apache version of Hadoop, you can still trial the version of the ODBC driver on the above link for 30 days, however you will need to pay for it to continue use.
I only mention the above as this ODBC driver is a more complete implementation of the ODBC specification than the open source one, and it can also do SQL-HiveQL translation which essentially means that you can plug it into Excel or Tableau or the like and have them issue standard SQL. As mc110 mentioned, you can make DSN or DSN-less connections and there is also a Windows configuration dialog available should you wish to use that.
Also, in the interests of full disclosure, I work for Simba Technologies.
As explained at https://cwiki.apache.org/confluence/display/Hive/HiveODBC, the Hive ODBC connector implements the ODBC API for Hive, potentially allowing a lot of existing well-written ODBC applications to seamlessly use Hive as they would any other database. The link also explains what API calls are and are not supported.
SQLDriverConnect is supported, which implies you can make DSN-less connections. I suggest you read the information from the link for more information. Also, http://www.cloudera.com/content/cloudera-content/cloudera-docs/Connectors/PDF/Cloudera-ODBC-Driver-for-Apache-Hive-Install-Guide.pdf has a section on configuring DSN-less authentication.
I am new to Java and i´m writing an assesy for school about database connections via JDBC.
Am i getting this right about the driver type 3:
The JDBC Type 3 driver is an all java driver witch calls JDBC Functions and sends them to a middle tier server, where they are transformed in vendor specific native database calls or to ODBC calls, which are then handled by an ODBC driver and sent to the database.
I also read that its possible to transform them to ODBC calls. I assume that this means a JDBC-ODBC-Bridge is used. If that is so, how is it possible to do that, because i read that ODBC drivers need to be installed on the Client and cant be loaded over the network(according to descriptions of driver type 1).
And furthermore, why on earth would anybody use a type 1 driver on Clientside, where you need to install native code and the ODBC driver on the Client machine?
Am I getting something wrong here or is the type 1 driver just an ancient technology which can be found in descriptions of JDBC but noone uses anymore.
Please help me getting the right idea.
http://www.jdbc-tutorial.com/jdbc-driver-types.htm has a good overview of the various JDBC driver types. As you suspected, the type 1 drivers are generally considered a legacy option nowadays.
You can find a good stack overflow reference on the same topic at What is type 1,2,3 or 4 of a JDBC Driver?
I want to connect terada but can i find different jdbc driver instead of terajdbc driver.
I mean I can connect MSSQL with mssql jdbc driver and also jtds jdbc driver.
Thanks.
Not aware of one offhand. If you are having specific problems have you considered opening an incident with the Teradata Global Support Center to obtain insight from their engineering staff?
What version of Teradata are you using? Have you tried using a newer version of the JDBC driver? For example Teradata 14's driver with Teradata 13.10 which is certified as backward compatible with Teradata 13.10 (sans Teradata 14 specific features).
I am looking for a sample program using the OCI JDBC driver (Implementation-Version: 11.2.0.1.0) trying the query notification feature provided by Oracle 11gr2. Since the oracle link shows a c/c++ example it would be great if someone has already tried out and can share a working sample using the oci jdbc driver.
Thank you.
What about the examples in the JDBC developer's guide:
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/dbmgmnt.htm#CHDEJECF
(Btw: I don't think OCI is required for this, with the 11.x drivers, this should work with the thin driver as well)