private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        String oldpass = new String(p1.getPassword());
      oldpass= Md5Hash.passwordsalted(oldpass);
      String a= new String (p2.getPassword());
       String b= new String (p3.getPassword());
       String newpass;
       String query;
   try{
              
              query="select password from users where username='"+username+"';";
              ResultSet rs =MyQueries.excQuery(query);
              rs.next();
              String BDoldpass=rs.getString("password");
              myClasses.Connections.close(); // Close connection to prevent Database lock
     if(!(oldpass.isEmpty()&&a.isEmpty()&&b.isEmpty()))
     {
         if(BDoldpass.equals(oldpass))     
          {   if((a.equals(b)))
            { 
            newpass=a;
            newpass=Md5Hash.passwordsalted(newpass);
            query="update users set password='"+newpass+"' where username='"+username+"'and password='"+oldpass+"'and type='issuer';";
            MyQueries.excUpdate(query);
            myClasses.Connections.close(); // Close connection to prevent Database lock
            JOptionPane.showMessageDialog (this,"Password Successfully Changed");
             }
             else
             {
                 JOptionPane.showMessageDialog (this, "Passwords do not match");
             }
         }
          else
          {
              JOptionPane.showMessageDialog (this, "Incorrect Password");
          }
      }else
     {
         JOptionPane.showMessageDialog (this, "Please enter the details");
     }
   }
      catch(Exception e)
      {
         logger.error("Error Description:", e);
       }        
    }//GEN-LAST:event_jButton1ActionPerformed