You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Jarek Jarcec Cecho (JIRA)" <ji...@apache.org> on 2012/10/15 17:00:06 UTC

[jira] [Commented] (SQOOP-456) Generated Java class does not distinguish date and timestamp in Oracle DB

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

Jarek Jarcec Cecho commented on SQOOP-456:
------------------------------------------

It appears to me that one of the recommended solutions is to provide property -Doracle.jdbc.V8Compatible="true". As we are supporting -D options (properties) on the command line does it make sense to introduce another command line option?

Jarcec
                
> Generated Java class does not distinguish date and timestamp in Oracle DB 
> --------------------------------------------------------------------------
>
>                 Key: SQOOP-456
>                 URL: https://issues.apache.org/jira/browse/SQOOP-456
>             Project: Sqoop
>          Issue Type: Bug
>          Components: codegen
>            Reporter: Cheolsoo Park
>            Priority: Minor
>
> In genereated Java class, both date and timestamp are considered as timestamps. For examples, the following getter method is generated for a date column:
> {code:xml} 
> public void readFields(ResultSet __dbResults) throws SQLException {
>   this.__cur_result_set = __dbResults;
>   this.DATA_COL0 = JdbcWritableBridge.readTimestamp(1, __dbResults);
> }
> {code}
> This happens because both date and timestamp is labeled as Types.TIMESTAMP by ConnManager. The fix seems straightforward. In ClassWriter, the new method getColTypeNamesForTable introduced by Bilung at SQOOP-352 should replace getColTypes(). 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira