You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Kalichar <ka...@yahoo.com> on 2004/08/03 02:15:17 UTC

Assistance with Timestamp

I have a simple POJO that is defined in Oracle as DATE_TEST {ID, CREATED} of 
type {NUMBER (9), DATE}. The equivalent POJO is:

class DateTest {
   public Integer ID;
   public Timestamp created;
   
   // Evuivalent getter/setters
   ....
}

repository mapping file is defined as follows:
<field-descriptor id="2"
   name="created"
   column="CREATED"
   jdbc-type="TIMESTAMP"
/>


I am hoping to store the Date in the format yyyy.MM.dd HH:mm:ss. How can I 
accomplish this. When I attempt to store my POJO, it stores it in a different 
format and while retrieving it, I seem to lose the "HH:mm:ss". 

Any assitance in the matter would be great. Thanks in advance.
Kalichar


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Assistance with Timestamp

Posted by kalichar <ka...@yahoo.com>.
The database I am using is Oracle. I am not doing anything to change the 
timestamp. I see that it is stored with detailed information in the database. 
However, it is not in the format I would like. Retreiving it does not include 
HH:mm:ss for some reason correctly. Thanks for the immediate response.

Kalichar



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Assistance with Timestamp

Posted by "Robert S. Sfeir" <ro...@codepuccino.com>.
Dunno what DB you're on, but the DB will store the timestamp based on the
JDBC driver/format your DB wants.

On the retrieving of the Timestamp be sure that you're calling it the right
way, OJB does nothing to remove information, if it doesn't come back from
you DB, it's not going to show up.

R


On 8/2/04 8:15 PM, "Kalichar" <ka...@yahoo.com> wrote:

> I have a simple POJO that is defined in Oracle as DATE_TEST {ID, CREATED} of
> type {NUMBER (9), DATE}. The equivalent POJO is:
> 
> class DateTest {
>    public Integer ID;
>    public Timestamp created;
>    
>    // Evuivalent getter/setters
>    ....
> }
> 
> repository mapping file is defined as follows:
> <field-descriptor id="2"
>    name="created"
>    column="CREATED"
>    jdbc-type="TIMESTAMP"
> />
> 
> 
> I am hoping to store the Date in the format yyyy.MM.dd HH:mm:ss. How can I
> accomplish this. When I attempt to store my POJO, it stores it in a different
> format and while retrieving it, I seem to lose the "HH:mm:ss".
> 
> Any assitance in the matter would be great. Thanks in advance.
> Kalichar
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org