Package com.cosmo.data

Examples of com.cosmo.data.DataAgent.execute()


         // Si existe esta asociaci�n, la elimina
         sql = "DELETE FROM " + TABLE_ROLE_ACTIVITIES + " " +
               "WHERE  actid  = '" + DataAgent.sqlFormatTextValue(activityId) + "' And " +
               "       roleid = '" + DataAgent.sqlFormatTextValue(roleId) + "'";
         conn.execute(sql);
      }
      catch (Exception ex)
      {
         throw new AuthorizationException(ex.getMessage(), ex);
      }
View Full Code Here


         // Actualiza los datos estadísticos y de control del usuario
         sql = "UPDATE " + TABLE_NAME + " " +
               "SET usrlastlogin  = current_timestamp, " +
               "    usrlogoncount = usrlogoncount + 1 " +
               "WHERE Lower(usrlogin) = '" + login.trim().toLowerCase() + "'";
         conn.execute(sql);

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (SQLException ex)
View Full Code Here

                "        '" + user.getName() + "', " +
                "             current_timestamp, " +
                "             null, " +
                "         " + 0 + ")";

         conn.execute(sSQL);

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (Exception ex)
View Full Code Here

                "SET   usrmail = '" + DataAgent.sqlFormatTextValue(user.getMail()) + "', " +
                "      usrname = '" + DataAgent.sqlFormatTextValue(user.getName()) + "' " +
                "WHERE Lower(usrlogin) = '" + user.getLogin().trim().toLowerCase() + "'";

         conn = DataFactory.getInstance(workspace);
         conn.execute(sSQL);

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (Exception ex)
View Full Code Here

         // Elimina el usuario
         sSQL = "DELETE FROM " + TABLE_NAME + " " +
                "WHERE Lower(usrlogin) = '" + login.trim().toLowerCase() + "'";

         conn = DataFactory.getInstance(workspace);
         conn.execute(sSQL);

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (Exception ex)
View Full Code Here

         // Actualiza la contrase�a del usuario
         sSQL = "UPDATE " + TABLE_NAME + " " +
                "SET   usrpwd = '" + CryptoUtils.encrypt(newPassword) + "' " +
                "WHERE Lower(usrlogin) = '" + login.trim().toLowerCase() + "'";

         conn.execute(sSQL);

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
      }
      catch (Exception ex)
View Full Code Here

         // Limpia bloqueos caducados (de m�s de [timeout] minutos)
         sql = "DELETE FROM " + TABLE_LOCKS + " " +
               "WHERE ((DATE_PART('day', CURRENT_TIMESTAMP - lastattempt) * 24 + " +
               "        DATE_PART('hour', CURRENT_TIMESTAMP - lastattempt)) * 60 + " +
               "        DATE_PART('minute', CURRENT_TIMESTAMP - lastattempt) >= " + timeout + ")";
         conn.execute(sql);

         // Consulta si el usuario dispone de un registro bloqueado:
         // Dispone de N intentos (o m�s) y el �ltimo intento hace menos de M minutos que se produjo
         sql = "SELECT Count(*) " +
               "FROM " + TABLE_LOCKS + " " +
View Full Code Here

         if (nregs > 0)
         {
            sql = "UPDATE " + TABLE_LOCKS + " " +
                  "SET lastattempt = CURRENT_TIMESTAMP, fails = fails + 1 " +
                  "WHERE lower(login) = '" + DataAgent.sqlFormatTextValue(login) + "'";
            conn.execute(sql);
         }
         else if (nregs <= 0)
         {
            if (loginExist(login))
            {
View Full Code Here

         {
            if (loginExist(login))
            {
               sql = "INSERT INTO " + TABLE_LOCKS + " (login, fails, lastattempt, ipaddress) " +
                     "VALUES ('" + DataAgent.sqlFormatTextValue(login) + "', 1, CURRENT_TIMESTAMP, '" + workspace.getServerRequest().getRemoteAddr() + "')";
               conn.execute(sql);
            }
         }

         // Confirma los cambios en la bbdd
         if (!conn.isAutoCommit()) conn.commit();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.