java.sql.Date is persisting timestamp with date in the Oracle DB date datatype field.

Solution Verified - Updated -

Issue

  • While using java.sql.Date datatype data member to persist the date in the Oracle DB field of tye Oracle Date datatype timestamp is getting persisted along with the date.
    The expected date should be 13-JAN-2019 00:00:00 but actual is 13-JAN-2019 16:14:36.
    e.g. java.sql.Date d = new Date(System.currentTimeMillis)

Environment

  • Red Hat JBoss Enterprise Application Platform
    • 7.x
  • Oracle
    • 11
    • 12

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content