TimestampScaleGT9Behavior
- Last Updated: July 29, 2026
- 1 minute read
- DataDirect Connectors
- JDBC
- Documentation
Purpose
Determines how the driver reports metadata for TIMESTAMP columns with fractional-seconds precision greater than 9.
Valid Values
VARCHAR | TIMESTAMP | MIXED
Behavior
If set to VARCHAR (default), the driver
reports the data type as VARCHAR (type code 12) and sets scale/DECIMAL_DIGITS to 0
in all metadata APIs (DatabaseMetaData, ParameterMetaData, and ResultSetMetaData)
when the scale exceeds 9. For scales of 9 or less, the driver reports the data type
as TIMESTAMP (type code 93). In each case, the returned values retain their full
precision.
If set to TIMESTAMP, the driver reports the
type as TIMESTAMP (type code 93) with the actual scale in all metadata APIs. During
fetch, values are truncated to 9 fractional digits because java.sql.Timestamp supports a maximum of 9 fractional digits.
If set to MIXED, the driver reports the type
as TIMESTAMP (type code 93) with the actual scale in DatabaseMetaData and
ParameterMetaData, but reports the type as VARCHAR (type code 12) in
ResultSetMetaData when the scale exceeds 9, while preserving full timestamp
precision. For scales of 9 or less, the type is reported as TIMESTAMP (type code
93).
Notes
- This option addresses metadata behavior for TIMESTAMP columns with precision
greater than 9. DB2 LUW supports these values but
java.sql.Timestampsupports only 9 fractional digits. - The default setting (
VARCHAR) keeps behavior consistent acrossDatabaseMetaData.getColumns(),ResultSetMetaData, andResultSet.getObject(), while preserving the full timestamp precision.
Data Source Methods
public String getTimestampScaleGT9Behavior()
public void setTimestampScaleGT9Behavior(String)
Default
VARCHAR
Data Type
String