Skip to content

Commit

Permalink
fix getColumnClassName() for timestamp_tz column (#1119)
Browse files Browse the repository at this point in the history
* fix getColumnClassName for timestamp_tz column

* add to test

Co-authored-by: Lorna Barber <[email protected]>
  • Loading branch information
SimbaGithub and Lorna Barber authored Aug 22, 2022
1 parent 9758960 commit db5bb61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/snowflake/client/jdbc/SnowflakeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ public static String javaTypeToClassName(int type) throws SQLException {
return Double.class.getName();

case Types.TIMESTAMP:
case Types.TIMESTAMP_WITH_TIMEZONE:
return Timestamp.class.getName();

case Types.DATE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ public void testGetDataTypeWithTimestampTz() throws SQLException {
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
// Assert that TIMESTAMP_TZ type matches java.sql.TIMESTAMP_WITH_TIMEZONE
assertEquals(resultSetMetaData.getColumnType(1), 2014);
// Assert that TIMESTAMP_TZ column returns Timestamp class name
assertEquals(resultSetMetaData.getColumnClassName(1), Timestamp.class.getName());
}
}
}

0 comments on commit db5bb61

Please sign in to comment.