The latest version of the Presto JDBC driver does not support getting data from the result set by boxed integer (java.lang.Integer), but only by the primitive int type. The node-java interop code converts all integers to boxed java.lang.Integer types. This creates a paradox whereby the codebase cannot be successfully utilized to connect to Presto.
Solution
JDBC drivers support data retrieval from result sets by passing in either the column index OR the column name / label. Data retrieval by column name also has more widespread support as it is more explicit. By updating the getters to use the cmd.label (column name) we are able to avoid the boxed integer issue and successfully utilize the presto JDBC driver.
Summary
Problem
The latest version of the Presto JDBC driver does not support getting data from the result set by boxed integer (
java.lang.Integer
), but only by the primitiveint
type. Thenode-java
interop code converts all integers to boxedjava.lang.Integer
types. This creates a paradox whereby the codebase cannot be successfully utilized to connect to Presto.Solution
JDBC drivers support data retrieval from result sets by passing in either the column index OR the column name / label. Data retrieval by column name also has more widespread support as it is more explicit. By updating the getters to use the
cmd.label
(column name) we are able to avoid the boxed integer issue and successfully utilize the presto JDBC driver.