on 07-10-2006 1:12 PM
Hai All,
I am getting problem while inserting Timestamp into Maxdb
Here iam giving Timestamp as input to the entityBean , and in database also i was taken that field as timestamp.
the following is the code snippert,
Date dte=new Date();
Calendar c = Calendar.getInstance();
java.sql.Timestamp t=new Timestamp(c.getTimeInMillis());
try {
objTestingEntityLocalHome.create(strArg1,intarg2,dblDouble,t);
} catch (CreateException e) {
return "Ex" +e;
}catch (Exception e) {
return "Ex: "+e;
}
whenever I run this program it is insering date correctly, but time stamp is inserting incurrectly,it is not inserting current time stamp of the server
anybody please help me inthis regard
thanks
somu
Hi,
try this:
GregorianCalendar c = new GregorianCalendar();
java.sql.Timestamp t=new Timestamp(c.getTimeInMillis());
Good luck,
Roelof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.