DAte widget

1
0
-1

Kindly please can someone help me how to get the exact date from date widget and store it in y database.

i am using some variable to stored some data like the dates choose by the actor while running the application and using it to store on my database? i usually encountered problems and doesn't which query should i use to convert the object into date format.

thank you so much, jaylongkit:)

Comments

Submitted by jeremykent2726_1 on Wed, 06/10/2015 - 10:46

which database are you using?

Submitted by jeremykent2726_1 on Wed, 06/10/2015 - 10:46

which database are you using?

Submitted by jaylongkit on Wed, 06/10/2015 - 10:52

My Sql database

1 answer

1
+1
-1

Assuming that you already have a MySql connector in place, to insert a date value into the database, you need to properly format it first in the query.

Example:

import java.text.DateFormat;
import java.text.SimpleDateFormat;


DateFormat mySimpleDateFormat =  new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");

//  The timestamp needs to be properly formatted.

String query =  "insert into my_table (entry_created_on) values ('"+mySimpleDateFormat.format(value)+"')"

return query

entry_created_on in this case is the name of the column in the database and value the name of the variable in bonita that is mapped to the date field on the form.

Comments

Submitted by jaylongkit on Thu, 06/11/2015 - 02:13

THank you so much:) jeremykent2726_1

it helps me a lot:)

it works:)

Notifications