I am trying to setup a JNDI Data Source on WebSphere 8.5.5.11, using hive-jdbc.jar.
When using the console in WebSphere, and using the form to create a new JDBC provider, there is a field for the implementation class name. WebSphere requires that the class implements javax.sql.XADataSource
or javax.sql.ConnectionPoolDataSource
. However, the hive-jdbc driver implements non of those, it implements only java.sql.DataSource
.
For this reason, it doesn't work, WebSphere reports an error when trying to save the form.
Any idea what can I do about this?
You can write a trivial implementation of
javax.sql.ConnectionPoolDataSource
that delegates to thejavax.sql.DataSource
implementation. Here is an example,Package your compiled class in a JAR alongside the JDBC driver JAR(s), and configure your custom JDBC provider in WebSphere Application Server to point at this JAR as though it were a part of the JDBC driver. Specify the implementation class name as
example.datasource.HiveConnectionPoolDataSource
or whatever package/name you chose for your own implementation. You should then be able to use the JDBC driver.Also adding a link to the WebSphere Application Server request for enhancements page if anyone wants to request that support for javax.sql.DataSource be added.