Uploaded image for project: 'GeoTools'
  1. GEOT-5823

Mapping DATE to java.sql.Timestamp in OracleDialect

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 17.2, 18-beta
    • Fix Version/s: 17.3, 18-RC1
    • Component/s: jdbc-oracle plugin
    • Labels:
      None
    • Environment:

      ojdbc7.jar, OpenJDK 1.8.0_141

      Description

      Oracle JDBC driver maps java.sql.Timestamp to the DATE database type by default. GeoTools maps DATE database type to java.sql.Date type because of backwards compatibility issues (caused by Oracle changing type mappings in previous versions of JDBC driver).

      Therefore, when creating ImageMosaic with time dimension and inserting granules with date and time attribute, values of the time dimension are converted from java.sql.Timestamp to java.sql.Date and the time information is lost just before inserting values into the database.

      In a past conversation on users mailing list Andrea Aime suggested creating a new mapping: java.sql.Timestamp to TIMESTAMP database type. I have manually verified that this does solve the problem (it is possible to create an image mosaic with java.sql.Timestamp attribute which maps to TIMESTAMP in the database and does retain the time information).

      I'm currently working on a PR providing the fix.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              peterko Peter Kovac
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: