Expand my Community achievements bar.

How to insert Date into Database from workbench.

Avatar

Former Community Member

Hi

I have requirement where  I need to  insert the currentDate and Time to the database.   Here I am using  as

At SQL Statement Info Editor ,have like these :

Type     value

Date     parse-dateTime(current-dateTime())

At DB I have Datatype  as DateTime( Using MySQL). Here i am getting error like :

Caused by: com.adobe.idp.dsc.jdbc.exception.JDBCIllegalParameterException: Type mismatch is found when preparing SQL statement. Expecting type 'date', but got type 'String'.

Could  any one tell me where I can find  detailed log say hibernate type... where exatly we are  getting error.(Expect jboss's server log).

Please tell how to  insert the date into the DB ASAP.

Thanks

Praveen

3 Replies

Avatar

Level 1

Are you passing the date as String or SQL Date?

Avatar

Level 10

The xPath date function will return a string, so make sure your database column is of type string.

Jasmin

Avatar

Former Community Member

Thanks for   all replies.

Eventually I  got  the solution  the post

From the Form (Using DatePicker) , we will get the DateTime  datatype to the Workbench. All  we need to  do is assign the  same to DateTime variable in the workbench and inserting the data to the DB.

It works.

Thanks

Praveen.