# I need to save the whole form in an external Data Base(MySql5.5) Bonita 7.2, how can I dot it in a better way?

**URL:** <https://community.ofelia.com/t/i-need-to-save-the-whole-form-in-an-external-data-base-mysql5-5-bonita-7-2-how-can-i-dot-it-in-a-better-way/7440>\
**Category:** Q&A\
**Created:** [9 June 2016 09:09 UTC](https://community.ofelia.com/t/i-need-to-save-the-whole-form-in-an-external-data-base-mysql5-5-bonita-7-2-how-can-i-dot-it-in-a-better-way/7440 "2016-06-09T09:09:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![htrujillo](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@htrujillo](https://community.ofelia.com/u/htrujillo)\
**Post date:** [9 June 2016 09:09 UTC](https://community.ofelia.com/t/i-need-to-save-the-whole-form-in-an-external-data-base-mysql5-5-bonita-7-2-how-can-i-dot-it-in-a-better-way/7440/1 "2016-06-09T09:09:33Z")

</div>

Hello every body!!! I wish some one could help me, I would thank any help.

Now I have make a Groovy script, and I use a jdbc mysql conector, but I have to map field by field to the query that makes the insert, this is a lite bit old school method, it is really tedious and archaic.  
I Would like to use Hibernate or JPA as ORM, to make a save or persist of the object, because I have to do it in many tasks, to save diferents Web forms, for an external Application.

This works, but I guess if I can do a external jar that uses hibernate an use this to save the object BPM of my flow or any object?

Here is a part of my source code:

[…]  
Sql sql = BonitaSql.newInstance(“jdbc:mysql://BBDD/\*\*\*”,“BBDD\_user”,“BBDD\_pass”, new com.mysql.jdbc.Driver());

```
try {
	String consulta = "INSERT INTO notificaciones (id,descRiesgo,dni_notificante,nombre_notificante,apellidos_notificante,correo_notificante,tipo_notificacion,asunto_notificacion,descripcion_notificacion) 
	VALUES (?,?,?,?,?,?,?,?,?)";

	sql.execute(consulta,null,
	notificacionRiesgo.getDescripcion(),notificacionRiesgo.getDni(), notificacionRiesgo.getNombre(),           

            notificacionRiesgo.getApellidos(),
	notificacionRiesgo.getCorreo(),notificacionRiesgo.getTipo(),
	notificacionRiesgo.getAsunto(),notificacionRiesgo.getDescripcion());	

```

}

[…]

Thanks

---

<div class="post-metadata">

**Author:** ![htrujillo](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@htrujillo](https://community.ofelia.com/u/htrujillo)\
**Post date:** [9 June 2016 09:58 UTC](https://community.ofelia.com/t/i-need-to-save-the-whole-form-in-an-external-data-base-mysql5-5-bonita-7-2-how-can-i-dot-it-in-a-better-way/7440/2 "2016-06-09T09:58:14Z")

</div>

Of course, I don’t want to use a data base connector with an sql script because I want to have more control and I wnat to to execute some actions before doing the insert.
