IBM / db2forzosdeveloperextension-about

IBM Db2 for z/OS Developer Extension for VS Code
https://IBM.github.io/db2forzosdeveloperextension-about/
Other
12 stars 7 forks source link

Timestamp ending in zero in SQL results gets truncated #133

Open gplambert opened 5 months ago

gplambert commented 5 months ago

When a timestamp is part of the SQL results and ends in a 0 (zero), the 0 is being truncated.

IDz customer reported the issue here -> https://l2l3-cmn-rtc.ratl.swg.usma.ibm.com:9443/ccm/web/projects/Rational%20Escalation#action=com.ibm.team.workitem.viewWorkItem&id=105487

IDz developer suspects the issue in the DSS library that IDz gets from DB2 team or maybe the DB2 driver jar.

Development environment where the bug occurred

When the SQL results contain a timestamp, and that timestamp ends in a zero, the zero is dropped from the display

Detailed steps for reproducing the problem:

Observed behavior

trailing zero is dropped

Expected behavior

trailing zero remains visible in output

Danuszek commented 5 months ago

Is somebody looking at this issue?

amadhavia commented 5 months ago

Is somebody looking at this issue?

Yes, we are looking into this issue.

Danuszek commented 4 months ago

Hello, is there any news? Please update ASAP.. Thx, Dante

equalchenbj commented 4 months ago

Hello @Danuszek As you may know we're using JDBC to communicate with db2, JDBC returns timestamp without tailing 0. It's a JDBC limitation here.

ResultSet rs = stmt.executeQuery("select * from SC795701.TEST");
while (rs.next()) {
    Timestamp ts = rs.getTimestamp(1);
    System.out.println(ts);
    String tss = rs.getString(1);
    System.out.println(tss);
}

The timestamp I inserted was '2024-02-07-11.27.07.474600'. But I got below after executing the program. 2024-02-07 11:27:07.4746 2024-02-07 11:27:07.4746

Danuszek commented 4 months ago

Hello @equalchenbj , is it something we can change? If yes, who can change this behaviour?

Danuszek commented 4 months ago

personally, I wouldn't mind but one of our customers does. Hence, my question.

equalchenbj commented 4 months ago

@Danuszek I can not find a way to change it.

Danuszek commented 4 months ago

ok

Danuszek commented 3 months ago

@equalchenbj , but why? Is it because you don't own the code?

equalchenbj commented 3 months ago

@Danuszek JDBC driver development is not under Db2 mission/scope. So we will work with that team and open an issue for them to work it out.