public void set(EntregaBean oEntregaBean) throws Exception { try { oMysql.conexion(enumTipoConexion); oMysql.initTrans(); if (oEntregaBean.getId() == 0) { oEntregaBean.setId(oMysql.insertOne("entrega")); } oMysql.updateOne( oEntregaBean.getId(), "entrega", "id_documento", Integer.toString(oEntregaBean.getDocumento().getId())); oMysql.updateOne( oEntregaBean.getId(), "entrega", "id_actividad", Integer.toString(oEntregaBean.getActividad().getId())); oMysql.updateOne( oEntregaBean.getId(), "entrega", "nota", Integer.toString(oEntregaBean.getNota())); SimpleDateFormat formatoFecha = new SimpleDateFormat("yyyy-MM-dd"); Date date = oEntregaBean.getFecha(); if (date == null) { date = new Date(); } String fecha = formatoFecha.format(date); oMysql.updateOne(oEntregaBean.getId(), "entrega", "fecha", fecha); oMysql.commitTrans(); } catch (Exception e) { oMysql.rollbackTrans(); throw new Exception("EntregaDao.set: Error: " + e.getMessage()); } finally { oMysql.desconexion(); } }