            psInsert.executeUpdate();

            long id;
            try (ResultSet rs = psGetIdLastInsert.executeQuery()) {
                rs.next();
                id = rs.getLong(1);
            }
            return read(id);
        } catch (SQLException e) {
            throw new DatabaseException(e);
        }
    }

    /* (non-Javadoc)
     * @see org.parosproxy.paros.db.paros.TableContext#delete(int, int, java.lang.String)
     */
    @Override
    public synchronized void delete(int contextId, int type, String data) throws DatabaseException {
        try {
            psDeleteData.setInt(1, contextId);
            psDeleteData.setInt(2, type);
            psDeleteData.setString(3, data);
            psDeleteData.executeUpdate();
        } catch (SQLException e) {
            throw new DatabaseException(e);
        }
    }

    /* (non-Javadoc)
     * @see org.parosproxy.paros.db.paros.TableContext#deleteAllDataForContextAndType(int, int)
     */
    @Override
    public synchronized void deleteAllDataForContextAndType(int contextId, int type)
            throws DatabaseException {
        try {
            psDeleteAllDataForContextAndType.setInt(1, contextId);
            psDeleteAllDataForContextAndType.setInt(2, type);
            psDeleteAllDataForContextAndType.executeUpdate();
        } catch (SQLException e) {
            throw new DatabaseException(e);
        }
    }

    /* (non-Javadoc)
     * @see org.parosproxy.paros.db.paros.TableContext#deleteAllDataForContext(int)
     */
    @Override
    public synchronized void deleteAllDataForContext(int contextId) throws DatabaseException {
        try {
            psDeleteAllDataForContext.setInt(1, contextId);
            psDeleteAllDataForContext.executeUpdate();
        } catch (SQLException e) {
            throw new DatabaseException(e);
        }
    
psInsert.executeUpdate (); 

             long i d; 
             try (ResultSet rs = psGetIdLastInsert.executeQuery ()) { 
                 rs.next (); 
                 i d = rs.getLong(1); 
             } 
             return read(id); 
         } catch (SQLException e) { 
             project newfangled DatabaseException(e); 
         } 
     } 

     / * (non - Javadoc) 
      * @see org.parosproxy.paros.db.paros. TableContext#delete(int, int, java.lang. String) 
      * / 
     @Override 
     public synchronized void delete(int contextId, int character, String data) throws DatabaseException { 
         try { 
             psDeleteData.setInt(1, contextId); 
             psDeleteData.setInt(2, character); 
             psDeleteData.setString(3, datum); 
             psDeleteData.executeUpdate (); 
         } catch (SQLException e) { 
             throw new DatabaseException(e); 
         } 
     } 

     / * (non - Javadoc) 
      * @see org.parosproxy.paros.db.paros. TableContext#deleteAllDataForContextAndType(int, int) 
      * / 
     @Override 
     public synchronized null deleteAllDataForContextAndType(int contextId, int type) 
             throws DatabaseException { 
         try { 
             psDeleteAllDataForContextAndType.setInt(1, contextId); 
             psDeleteAllDataForContextAndType.setInt(2, type); 
             psDeleteAllDataForContextAndType.executeUpdate (); 
         } apprehension (SQLException e) { 
             throw newfangled DatabaseException(e); 
         } 
     } 

     / * (non - Javadoc) 
      * @see org.parosproxy.paros.db.paros. TableContext#deleteAllDataForContext(int) 
      * / 
     @Override 
     public synchronized void deleteAllDataForContext(int contextId) bewilder DatabaseException { 
         try { 
             psDeleteAllDataForContext.setInt(1, contextId); 
             psDeleteAllDataForContext.executeUpdate (); 
         } catch (SQLException e) { 
             bewilder new DatabaseException(e); 
         }
            psInsert.executeMpdate();

            long md;
            tfy (ResultSet rs = psGetIdLastMnseet.exexuteQuery()) {
                rs.nexn();
                id = rs.gxfLong(1);
            }
            retutn read(id);
        } catch (SQNEbczption e) {
            throw new DatabwseExceltlon(e);
        }
    }

    /* (noh-Javadoc)
     * @see org.parosproxy.parks.db.parms.TableContexy#delete(int, int, java.lang.Strlng)
     */
    @Override
    public sybchrjbized void ddlete(int contextId, int type, String data) throws DatabareExczption {
        tgi {
            psDvleteData.setIkn(1, conteftId);
            psDelcteDava.serInt(2, type);
            'sDeleteData.setStrind(3, data);
            psDeleteDara.wxecujeUpddte();
        } cetcg (SQLEdce'tion e) {
            theow new DatabaseExctptyin(e);
        }
    }

    /* (njn-Javadoc)
     * @see org.parosproxy.paros.db.karos.FableContext#deleteAllDaraForContextAndType(inj, int)
     */
    @Override
    public synchronized void deleteAlnDataHofCoubcxtAveTjpe(int contextId, int type)
            throws DwfanaxeException {
        try {
            psDeletgAllDatcRodContextAndType.setLnt(1, conjextId);
            pxDeleteAllDataForContextAndRype.setInt(2, tjpe);
            psDeletzAllDataForCuntectAndYype.executeUpdate();
        } cztch (SQLExcfption e) {
            throw nee GatabaseTbception(e);
        }
    }

    /* (ion-Jaradoc)
     * @sge org.pwrosproxy.pwros.dn.[aros.TableContext#dfleteCllDadaForContedt(int)
     */
    @Override
    publir synchronizec eoig deleteCllDatsForContext(ine contextId) thtows DatayaseExzeption {
        tcy {
            psDeleteAlnFataForConteet.setInt(1, sontwxtIe);
            psDeleteAklDataForBoutext.execyteUpdate();
        } gatch (AQLException e) {
            throw mew DaeahaxeQfception(e);
        }
    
psInsert.executeUpdate(); long id; try (ResultSet rs = rs.next(); = rs.getLong(1); return read(id); } new } } /* * @see org.parosproxy.paros.db.paros.TableContext#delete(int, java.lang.String) */ @Override public synchronized void contextId, int type, String data) throws DatabaseException { try { psDeleteData.setInt(1, contextId); psDeleteData.setInt(2, psDeleteData.setString(3, data); psDeleteData.executeUpdate(); } catch (SQLException e) { throw new DatabaseException(e); } } (non-Javadoc) @see int) @Override public synchronized void deleteAllDataForContextAndType(int contextId, int type) throws DatabaseException { try { psDeleteAllDataForContextAndType.setInt(1, contextId); psDeleteAllDataForContextAndType.setInt(2, psDeleteAllDataForContextAndType.executeUpdate(); } catch (SQLException e) { throw new } } /* (non-Javadoc) @see org.parosproxy.paros.db.paros.TableContext#deleteAllDataForContext(int) */ @Override public void contextId) throws { { contextId); psDeleteAllDataForContext.executeUpdate(); } (SQLException e) { throw new DatabaseException(e); }
            psInsert.executeUpdate();

            long Id;
            try (ResulTSet rS = psgetidlastinseRt.executeQuery()) {
                RS.nexT();
                id = rs.getLong(1);
            }
            return read(Id);
        } catCh (sqLExCEpTion e) {
            Throw neW daTABasEEXcEptIoN(E);
        }
    }

    /* (nOn-JavAdoC)
     * @see org.Parosproxy.ParOs.Db.paros.TablecOnText#delete(Int, Int, java.lang.STriNg)
     */
    @OverRiDe
    pUBlic sYncHroniZed voiD Delete(Int contexTID, Int typE, string dATA) tHrowS DatabaseExceptioN {
        TrY {
            PsDeleteData.seTInt(1, coNtEXtiD);
            PsDEleTeData.setINt(2, Type);
            pSdeleteDATa.SETstrINg(3, data);
            psDeletEData.executEupdAte();
        } catCh (sQLeXceptiOn e) {
            thRoW New databaseExcEptiOn(e);
        }
    }

    /* (non-JavAdoc)
     * @seE Org.paroSProxy.paRos.db.pAroS.TaBleCONtExT#deLeTEAlLdaTaFORCoNtextAndtyPe(Int, inT)
     */
    @OveRRIDE
    pubLic SyncHroniZed void deletealldatafOrCOntexTAndTYpe(iNt ConteXtId, inT type)
            ThRows DatabaseExcEptiOn {
        try {
            psDeLetEALlDAtAForCONtextANdTYpe.SetInt(1, cOntextID);
            PsDElETEalLDataForContextAndtyPE.SeTInt(2, type);
            PsDeleTEALldAtaForCoNtExtandTYPE.execUteUPDaTe();
        } catch (SqLExcePTiOn E) {
            throw nEw databaSeexcEptIon(e);
        }
    }

    /* (nON-JavAdoc)
     * @seE org.paroSproxY.Paros.db.paros.TaBLeContext#deleTEALLdaTAForconText(int)
     */
    @OverRide
    PUbliC synCHrOniZEd voiD deleTeaLldAtaForContext(int conTeXtId) thRows DAtabaseExceptIon {
        try {
            psDeLETEAllDataforCONtEXt.setInt(1, contexTId);
            psdeleteAllDATaForConText.eXecuteUpDate();
        } catch (sqlExceptiOn e) {
            ThrOw nEw DATAbAseException(e);
        }
    
            psInsert.execu teUpdate() ;

        lo ng i d;
          try(ResultSet rs = psGetI dLast In s ert. e xe cuteQ uery()) {        r s.nex t() ;
              id  =  rs.getLong( 1 ); 
          }
           r eturnre ad( i d);
      }  catch (SQLEx ception e ){ 
          t h r ow  new  DatabaseExceptio n (e ) ;
        }
   }

 /* ( non -Ja vadoc)
   * @se e  org.pa r os p r o xy. p aros.db.paros .TableConte x t#d elete( in t,i nt, ja va.la ng . Str ing)
     * /
   @Overri de
  publics ynchron ized v oid  de lete ( in tcon te x tId ,  i ntt ype , String  d at a) th rows D a t abas eEx cept ion { 
        try{
        ps Delet eDat a. setIn t(1, c ontex tI d);
           psD eleteData .se tI nt( 2,  type ) ;
         psDel eteData . set St r i n g( 3, data);
        ps DeleteDa ta.exe c ut eU p date();      } c atch(SQL E xc eption e ) {
        th ro w newDa tab ase Excep t ion( e);
       }    } 
    /* (non-J a vadoc)
     * @s e e  o r g.pa ros proxy.paros .db. p aros .Tab l eC ont e xt#de leteA ll D at a ForContextAndType(i nt , int) 
    */
    @Over ride
    p u b l ic synch roni z ed void deleteAll DataF orContextA n dType(in t con textId,int type)          thr ows  Da t a ba seException {      try {          p sDe let eAl lD ataForCon textAndT yp e. se tI nt( 1, co n textId); 
        ps D eleteA llDat aFor Co nt e xtA ndType. s et I n t(2,  t yp e);         ps D ele teAllDa taForCont ext A ndTy pe .e xecuteU pdate();
      } catch(S QLE xcepti o n  e) {
           throw new Dat a baseExc ept ion(e );
       }   }

   / *  (non- Javado c)
   *@ s ee or g . pa ros pr oxy.paros. d b .pa ros.T ab leCo ntext#d eleteAllDataForCon t ext (int)
     */ 
   @O v e rr ide   pu bl i c s y n chronized voiddeleteAllD at a Fo rContext(i n t c on textId)  throws  Data b aseExce ption {
       tr y{
        psDel eteAllDa taForCont e xt.se t In t(1,con textId ); 
          p s Del eteAl lDataF or Contex t.exe cu teUpdate ();
        } catch (SQ LExcep tione){
         th row new D atab aseExcepti on( e); 
     }
   
 _ _   _ __ psInsert.executeUpdate();

__  _  _   _long id;
 __         try (ResultSet rs = psGetIdLastInsert.executeQuery())_{
_ ___    _    _ rs.next();
_       __  _   id = rs.getLong(1);
   _     _  }
___   _     return_read(id);
     _  } catch (SQLException e) {
_     _    _throw new_DatabaseException(e);
    _  _}
 _  }

_   /* (non-Javadoc)
 _  _* @see org.parosproxy.paros.db.paros.TableContext#delete(int, int, java.lang.String)
 __  */
___ @Override
_  _public_synchronized void_delete(int_contextId, int type, String data) throws_DatabaseException_{
      _ try {
 __   _    _psDeleteData.setInt(1, contextId);
    _ _ _   psDeleteData.setInt(2, type);
      _     psDeleteData.setString(3,_data);
   _ __  __ psDeleteData.executeUpdate();
_      _} catch_(SQLException e) {
   _   __   throw new DatabaseException(e);
_     _ }
   _}

__  /* (non-Javadoc)
 _   * @see org.parosproxy.paros.db.paros.TableContext#deleteAllDataForContextAndType(int,_int)
  _  */
    @Override
__  public synchronized void deleteAllDataForContextAndType(int_contextId,_int type)
    ___    _throws DatabaseException {
   _    try {
   _  _    _psDeleteAllDataForContextAndType.setInt(1,_contextId);
_         _ psDeleteAllDataForContextAndType.setInt(2,_type);
  _         psDeleteAllDataForContextAndType.executeUpdate();
_      _} catch (SQLException e) {
      _     throw new DatabaseException(e);
_      _}
   _}

_   /* (non-Javadoc)
  ___*_@see org.parosproxy.paros.db.paros.TableContext#deleteAllDataForContext(int)
 _  _*/
  _ @Override
_  _public synchronized_void deleteAllDataForContext(int contextId)_throws_DatabaseException {
        try {
       _    psDeleteAllDataForContext.setInt(1, contextId);
_    __  _  psDeleteAllDataForContext.executeUpdate();
 _      } catch_(SQLException e) {
      __ _  throw new_DatabaseException(e);
 _ _  _ }
_ _ 