Hi Swetha, writing to DB would be pretty much the same technique as pulling data from the DB. You will need to create services containing Insert statements and then you can substitute the values with the values entered by the users e.g. in a mashup.
For e.g. services you can give this a try Types of JDBC Calls from JDBC Extension & RDBMS Extension in ThingWorx