JDBC wrong timestamp representation if precision was 0 in the session

Details

Detail name Value
Changelog Number 22438
Type Bug
Status Resolved
Affected Versions JDBC 24.2.0
Fix Versions JDBC 25.2.2
Resolution Date 2025-02-26

Description

You can change the size of the timestamps fraction part shown by the driver in the session. As an example, this statement sets the fraction part output for the current session to 5 digits:

alter session set nls_timestamp_format='YYYY-MM-DD HH:MI:SS.FF5'

This will have impact in the output of the

result.getString(<col>)

method. If no fraction digits at all were set in the session, using

alter session set nls_timestamp_format='YYYY-MM-DD HH:MI:SS'

the driver will still show some digits if in the value were any.

Workaround

Format timestamp values as strings in the query using function TO_CHAR.

Fix

No more digits are shown if this is set in the server session.