EJB Designer converts Oracle type Timestamp to type Date for entity beans

Abstract: EJB Designer converts Oracle type Timestamp to type Date for entity beans

Issue:

When viewing a Oracle 8i datasource in the EJB Designer, the column properties for a table is defined as type Timestamp. When an entity bean is created from the table, however, the type is set to Date. During runtime, the Date returned to a client is missing the time (e.g. 2003-12-25 00:00:00.0). How is this issue solved?

Solution:

After creating your entity bean, merely change the data type from java.sql.Date to java.sql.Timestamp in the EJB Designer (click on the Date field in the Entity bean and switch the Type to Timestamp).

Then simply rebuild/redeploy -- the value for the field returned to the client will include both date and time values (2003-12-25 07:01:29.0).