Réf. : date fields / oracle

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Réf. : date fields / oracle

bernard.noel

You can use TIMESTAMP instead of DATE

<column name="LAST_LOGIN"  type="TIMESTAMP"/>



                                                                                                                   
                    Roel van Dijk                                                                                  
                    <rdvdijk@gmai        Pour :  Apache Torque Users List <[hidden email]>              
                    l.com>               cc :                                                                      
                                         Objet :      date fields / oracle                                          
                    09/05/2005                                                                                      
                    16:19                                                                                          
                    Veuillez                                                                                        
                    répondre à                                                                                      
                    "Apache                                                                                        
                    Torque Users                                                                                    
                    List"                                                                                          
                                                                                                                   
                                                                                                                   




I'm using Torque as part of Apache Jetspeed, and was wondering about
date fields. I've created a custom table, which has a column
declaration like this:

<column name="LAST_LOGIN"  type="DATE"/>

Then I do this in my Java code:

Date now = new Date();
entry.setLastLogin(now);

My Oracle (9) database now has this entry:
2002-05-09 00:00:00

As you can see, the time has not been stored. Is there a way to fix
this? (is there something like a datetime type?)

As a sidenote, where can I find a list of the available column types
that I can use in my XML schema?

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Réf. : date fields / oracle

Roel van Dijk
On 5/9/05, [hidden email] <[hidden email]> wrote:
> You can use TIMESTAMP instead of DATE
> <column name="LAST_LOGIN"  type="TIMESTAMP"/>

This still gives me me a time of 00:00:00 in the database..

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Réf. : date fields / oracle

Robert Kromkamp
In reply to this post by bernard.noel
Does it really go wrong with inserting the record into the database?

What's the result when you just print the date/timestamp before saving it.
Perhaps you do something wrong with assigning a value.

-----Original Message-----
From: Roel van Dijk [mailto:[hidden email]]
Sent: maandag 9 mei 2005 16:44
To: Apache Torque Users List
Subject: Re: Réf. : date fields / oracle


On 5/9/05, [hidden email] <[hidden email]> wrote:
> You can use TIMESTAMP instead of DATE
> <column name="LAST_LOGIN"  type="TIMESTAMP"/>

This still gives me me a time of 00:00:00 in the database..

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Réf. : date fields / oracle

Sriram Puvvada
In reply to this post by bernard.noel
I had the same issue. Change the datatype for the column from date to
timestamp then timestamp value will be inserted.
Hope this will help your problem.

Sriram.
-----Original Message-----
From: Robert Kromkamp [mailto:[hidden email]]
Sent: Monday, May 09, 2005 10:53 AM
To: 'Apache Torque Users List'
Subject: RE: Réf. : date fields / oracle

Does it really go wrong with inserting the record into the database?

What's the result when you just print the date/timestamp before saving it.
Perhaps you do something wrong with assigning a value.

-----Original Message-----
From: Roel van Dijk [mailto:[hidden email]]
Sent: maandag 9 mei 2005 16:44
To: Apache Torque Users List
Subject: Re: Réf. : date fields / oracle


On 5/9/05, [hidden email] <[hidden email]> wrote:
> You can use TIMESTAMP instead of DATE
> <column name="LAST_LOGIN"  type="TIMESTAMP"/>

This still gives me me a time of 00:00:00 in the database..

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Réf. : date fields / oracle

Roel van Dijk
In reply to this post by Robert Kromkamp
On 5/9/05, Robert Kromkamp <[hidden email]> wrote:
> Does it really go wrong with inserting the record into the database?
>
> What's the result when you just print the date/timestamp before saving it.
> Perhaps you do something wrong with assigning a value.

That's the first thing I checked ;-) The fault is indeed in the
insert. I'll try the TIMESTAMP trick tomorrow when I get back to work.
Thanks for all the input,

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]