cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA JDBC driver issue

eddy_guo3
Explorer
0 Kudos

Last week we had an issue that a NullPointerException was thrown when we tried to use SAP HANA JDBC driver, and in our case it was caused by a property called “hostlist” which was added by SAP HANA JDBC driver.

In our system we use BoneCP to manage database connections which uses java.sql.DriverManager to manage JDBC drivers, and we have several other JDBC drivers loaded. When we try to establish a connection to a SAP HANA server, java.sql.DriverManager.getConnection method will be called, and the SAP HANA driver will add a property, which uses “hostlist” as key and an array list as value, to the property list, and this property list will also be used by other registered JDBC drivers. In our case, this “hostlit” property caused postgreSQL JDBC driver to throw a NullPointerException. Our workaround for this issue is to remove this property after the SAP HANA JDBC driver added it, and it works fine for now, but we don’t know if there would be other problems.

Since we caught this problem in java.sql.DriverManager.getConnection method which is part of the JDK 1.7 and thus this should be a standard way to handle JDBC connection, we wonder if this could be a bug of SAP HANA JDBC driver.

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi Eddy,

wouldn't that be a bug of the BoneCP framwork to add driver specific attributes to all registered drivers?

For SAP HANA the hostlist is relevant in any multi-host scenario, so removing the information is probably not what you want to do.

- Lars

eddy_guo3
Explorer
0 Kudos

Hi Lars,

It is good to know that and the hostlist parameter is legit for a multi-host scenario. I no longer think this is a bug of SAP HANA JDBC driver. I am not sure if BoneCP framework should hide driver specific parameter from other driver.  Our own code does so. We are using the standard Java jdbc manager to do the process, the manager passes the parameter list to every registered jdbc driver. SAP HANA JDBC dirver added hostlist parameter to the list. After JDBC HANA driver is done with the parameter list, our code deletes the hostlist parameter before pass the parameter list to next registered driver.

Eddy

Answers (0)