Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Issue on ojdbc 23.3.0.23.09 with LocalDate parameter

Iñaki PerezJan 9 2024

We have a DEMO table containing a TIMESTAMP column:

create table DEMO
(
  DEMO_TIMESTAMP TIMESTAMP
)

…and we execute an INSERT operation with a LocalDate parameter:

try (final PreparedStatement st = connection.prepareStatement("INSERT INTO DEMO (DEMO_TIMESTAMP) VALUES (?)")) {
  st.setObject(1, LocalDate.now());
  st.executeUpdate();
}

When inspecting the DEMO_TIMESTAMP column we get different values depending on the ojdbc11 version used:

  • Version 21.11.0.0 - Value: 2024-01-09 00:00:00.000000
  • Version 23.3.0.23.09 - Value 2024-01-09 12:00:00.000000

Could this be an issue?

Comments

Processing

Post Details

Added on Jan 9 2024
0 comments
388 views