1

I am trying to get Datetime from Informix and stored it in SQL Server through Java by using java.util.Date datatype in Java and datetime2 datatype in SQL Server but I am getting decimals difference between SQL data and Informix data and this creates a comparison problem for me.

Can anyone suggest me to fix this decimal mismatch?

Dale K
  • 25,246
  • 15
  • 42
  • 71
Rimsha
  • 11
  • 2
  • 2
    Don't use `java.util.Date` or `java.sql.Date`, they are just causing trouble. Use the classes from `java.time`, you can properly define offsets and time zones. A good lecture might be one of the answers to [this question](https://stackoverflow.com/questions/42766674/java-convert-java-time-instant-to-java-sql-timestamp-without-zone-offset) or [this question](https://stackoverflow.com/questions/58099500/issue-in-saving-current-date-with-utc-time-in-sql-server) given by @BasilBorque. – deHaar May 29 '20 at 08:31

0 Answers0