IBM / trino-db2

Db2 JDBC connector for Trino
Apache License 2.0
18 stars 30 forks source link

ODBC connector or bridge for DB2 #46

Closed amitsadaphule closed 4 years ago

amitsadaphule commented 4 years ago

This is more of a query than an issue. I couldn't find a recommended channel for queries/questions. My team was looking for DB2 ODBC connector for one of the products, when we came across this connector. We were able to build it on ppc64le RHEL7.6 and the test execution was successful too. However, the product requirement is an ODBC connector. The documentation on the home page clearly mentions that this is a plugin for IBM DB2 Jdbc connection. I was wondering if there is something that can maybe act as a bridge for ODBC using this connector or if you have an ODBC DB2 connector. Thanks!

shawnzhu commented 4 years ago

To be precise, this connector for Prestosql does depend on JDBC type 4 driver of Db2. see https://github.com/IBM/presto-db2/blob/acc92bfe7f408255c61d448503c316069b4085e9/pom.xml#L17-L21

So it's not based on ODBC connection (JDBC type 1, can be bridged to JDBC) nor any other native compiled code (JDBC type 2).

I was wondering if there is something that can maybe act as a bridge for ODBC using this connector

This is possible since you can try to hack the method getConnectionFactory() via JDBC type 1 driver (uses ODBC interface).

https://github.com/IBM/presto-db2/blob/acc92bfe7f408255c61d448503c316069b4085e9/src/main/java/io/prestosql/plugin/db2/DB2ClientModule.java#L55-L70

Following☝️approach, it will need more work including installing/redistributing Db2's ODBC drivers/dependencies for specific Db2 release/installation. Which might not be done via this project under Apache License v2.0.

Out of the context of prestosql, Db2 client driver for Python/Node.js/Golang depend on ODBC driver and all of them works out of box. E.g., https://github.com/ibmdb/python-ibmdb

amitsadaphule commented 4 years ago

Thanks for the quick and detailed response @shawnzhu! I'll discuss the options with my team.

amitsadaphule commented 4 years ago

@gerrith3 @seth-priya FYI