• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB date/time  RSS feed

 
shyam jakki
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i map Date/Time field to Oracle database With CMP?
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • 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.
     
    Rashmi Tambe
    Ranch Hand
    Posts: 418
    • Mark post as helpful
    • send pies
    • 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.
     
    Consider Paul's rocket mass heater.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!