• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

EJB date/time

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do i map Date/Time field to Oracle database With CMP?
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shyam,
The JDBC Developer's Guide and Reference (part of the Oracle documentation) contains this information. One of the places you can access the Oracle documentation from is:
http://tahiti.oracle.com
You need to register with the site first, but registration is free.
Unfortunately, the mapping is not consistent, and depends on things like
  • the Oracle database version you are using
  • the EJB container you are using
  • the JDBC driver you are using

  • Excuse me, but I couldn't find any of those details in your post, so what I am about to say may prove to be totally incorrect for your situation.
    Usually, the (Oracle) DATE datatype maps to either "java.sql.Timestamp" or "java.sql.Date".
    Good Luck,
    Avi.
     
    Ranch Hand
    Posts: 418
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi shyam,
    U can use java.util.date to map to oracle DATE. java.sql.Date is also fine, however, it can not represent time alelement, it has only Date components...so use java.util.date to get both date and time.
     
    The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic