Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/jdbc/MonetResultSetMetaData.java @ 885:e1f00e0e3598
Improve isSigned() information on result columns and parameters of Types.DATE, Types.TIMESTAMP and Types.TIMESTAMP_WITH_TIMEZONE. These can have a negative year.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Wed, 03 Apr 2024 15:02:24 +0200 (13 months ago) |
parents | e890195256ac |
children | 4f50019b2cf8 |
comparison
equal
deleted
inserted
replaced
884:1956d8ba5ad3 | 885:e1f00e0e3598 |
---|---|
360 case Types.REAL: | 360 case Types.REAL: |
361 case Types.FLOAT: | 361 case Types.FLOAT: |
362 case Types.DOUBLE: | 362 case Types.DOUBLE: |
363 case Types.DECIMAL: | 363 case Types.DECIMAL: |
364 case Types.NUMERIC: | 364 case Types.NUMERIC: |
365 case Types.DATE: // year can be negative | |
366 case Types.TIMESTAMP: // year can be negative | |
367 case Types.TIMESTAMP_WITH_TIMEZONE: | |
365 return true; | 368 return true; |
366 case Types.BIGINT: | 369 case Types.BIGINT: |
367 try { | 370 try { |
368 final String monettype = types[column - 1]; | 371 final String monettype = types[column - 1]; |
369 // data of type oid or ptr is not signed | 372 // data of type oid or ptr is not signed |
372 return false; | 375 return false; |
373 } catch (IndexOutOfBoundsException e) { | 376 } catch (IndexOutOfBoundsException e) { |
374 throw MonetResultSet.newSQLInvalidColumnIndexException(column); | 377 throw MonetResultSet.newSQLInvalidColumnIndexException(column); |
375 } | 378 } |
376 return true; | 379 return true; |
377 // All other types should return false | |
378 // case Types.BOOLEAN: | |
379 // case Types.DATE: // can year be negative? | |
380 // case Types.TIME: // can time be negative? | |
381 // case Types.TIME_WITH_TIMEZONE: | |
382 // case Types.TIMESTAMP: // can year be negative? | |
383 // case Types.TIMESTAMP_WITH_TIMEZONE: | |
384 default: | 380 default: |
385 return false; | 381 return false; |
386 } | 382 } |
387 } | 383 } |
388 | 384 |