[ 
https://issues.apache.org/jira/browse/CALCITE-4970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467046#comment-17467046
 ] 

Knut Forkalsrud commented on CALCITE-4970:
------------------------------------------

Pull request: https://github.com/apache/calcite-avatica/pull/170

> Avatica ResultSet getObject with class argument fails unnecessarily
> -------------------------------------------------------------------
>
>                 Key: CALCITE-4970
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4970
>             Project: Calcite
>          Issue Type: Improvement
>          Components: avatica
>    Affects Versions: avatica-1.20.0
>            Reporter: Knut Forkalsrud
>            Priority: Minor
>
> The default implementation of Avatica's Cursor method
> {{public <T> T getObject(Class<T> type) throws SQLException}}
> thrown an exception about not being able to convert. However, there is the 
> trivial case when no conversion is necessary. I propose returning the same 
> value as {{getObject()}} does, when that's an acceptable type.
>  
> The background for this is our experience with different JDBC drivers. Our 
> in-house "query master" tries to visualize result sets. We use 
> {{ResultSetMetaData.getColumnTypeName}} to figure out which type to expect. 
> Some drivers don't necessarily produce objects of the same type when we call 
> {{{}getObject{}}}, but they do convert to the right type when we call the 
> method with the class as an argument.
>  
> Pull request forthcoming.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to