Using Calelndar for timestamp

Hi All,

I am new to jsf . I am using Sun Java Studio Creator 2.I am trying to insert timestamp value from a calendar.Iam using sql timestamp converter to convert date to timestamp.I binded the calendar to the timestamp column .while inserting data i am geting following error:

java.lang.RuntimeException: Number of conflicts while synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 0 [sunm][DB2 JDBC Driver]Unable to determine the type of the specified object.

at com.sun.data.provider.impl.CachedRowSetDataProvider.commitChanges(CachedRowSetD ataProvider.java:878)

What should i do?

[618 byte] By [sushilkumar] at [2007-11-26 8:09:20]
# 1
Bumping... I am curious as to how you can bind a calendar component to insert into a db.
jbjonesjr at 2007-7-6 20:58:05 > top of Java-index,Development Tools,Java Tools...
# 2

Hi,

Actually, somehow i was able to insert timestamp data into database using calendar .It is not best practices.I put the following code in prerender to show data from database into calender field:

if(getSessionBean1().getVam_dunning_calenRowSet().size()>0)

{

billto.setValue((java.util.Date)vam_dunning_calenDataProvider.getValue("VAM_DUN NING_CALEN.BILL_TO_DT"));

billfromdt.setValue((java.util.Date)vam_dunning_calenDataProvider.getValue("VAM _DUNNING_CALEN.BILL_FROM_DT"));

}

Here BILL_TO_DT and BILL_FROM_DT are timestamp in database.I put the following code in submit to insert data from calendar to timestamp field in database:

if(billto.getValue()!=null) {

vam_dunning_calenDataProvider.setValue("VAM_DUNNING_CALEN.BILL_TO_DT",(new java.sql.Timestamp(((java.util.Date)billto.getValue()).getTime()).toString()));

}

if(billfromdt.getValue()!=null) {

vam_dunning_calenDataProvider.setValue("VAM_DUNNING_CALEN.BILL_FROM_DT",(new java.sql.Timestamp(((java.util.Date)billfromdt.getValue()).getTime()).toString( )));

}

So. Finally i was able to put timestamp data from calendar into database and show timestamp data back to calendar in date format.I think the following work can be done by using converter and directly binding the calender to database field.Anyway by writing some dirty code i was able to get what i needed.

thanks

sushil

sushilkumar at 2007-7-6 20:58:05 > top of Java-index,Development Tools,Java Tools...