Código:
package Logica; import BaseDatos.Helper; import java.io.PrintStream; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.Random; public class paginaLogin { public static List dameArregloRandom() { List arreglo = new ArrayList(); Random ran = new Random(); int r = ran.nextInt(10); arreglo.add(Integer.valueOf(r)); while (arreglo.size() < 10) { int numR = ran.nextInt(10); int i = 0; while (i < arreglo.size() && numR != ((Integer)arreglo.get(i)).intValue()) {if (++i == arreglo.size()) {arreglo.add(Integer.valueOf(numR));}} } return arreglo;} public static ResultSet ValidarBD(String opcion, String numero, String clave) { String sqlQuery; String sqlQueryCount; sqlQuery = "SELECT * FROM dbo.SOCIOS WHERE "; sqlQueryCount = "SELECT COUNT(*) FROM dbo.SOCIOS WHERE "; if (opcion.compareTo("item1") != 0) { break MISSING_BLOCK_LABEL_167; } ResultSet rs; String nCuenta = numero; sqlQuery = (new StringBuilder()).append(sqlQuery).append("CUENTA= '").append(nCuenta).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); sqlQueryCount = (new StringBuilder()).append(sqlQueryCount).append("CUENTA= '").append(nCuenta).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); System.out.println(sqlQueryCount); rs = Helper.executeCommand(sqlQueryCount); rs.next(); if (rs.getInt(1) != 1) { break MISSING_BLOCK_LABEL_143; } rs = Helper.executeCommand(sqlQuery); return rs; rs.close(); return null; SQLException ex; ex; System.out.println(ex.getMessage()); return null; if (opcion.compareTo("item2") != 0) { break MISSING_BLOCK_LABEL_315; } String nCuenta = numero; sqlQuery = (new StringBuilder()).append(sqlQuery).append("TIPO_IDEN= 01 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); sqlQueryCount = (new StringBuilder()).append(sqlQueryCount).append("TIPO_IDEN= 01 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); rs = Helper.executeCommand(sqlQueryCount); rs.next(); if (rs.getInt(1) != 1) { break MISSING_BLOCK_LABEL_293; } rs = Helper.executeCommand(sqlQuery); return rs; rs.close(); return null; nCuenta; System.out.println(nCuenta.getMessage()); if (opcion.compareTo("item3") != 0) { break MISSING_BLOCK_LABEL_463; } String nCuenta = numero; sqlQuery = (new StringBuilder()).append(sqlQuery).append("TIPO_IDEN= 03 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); /* 109*/ sqlQueryCount = (new StringBuilder()).append(sqlQueryCount).append("TIPO_IDEN= 03 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); rs = Helper.executeCommand(sqlQueryCount); rs.next(); if (rs.getInt(1) != 1) { break MISSING_BLOCK_LABEL_441; } rs = Helper.executeCommand(sqlQuery); return rs; rs.close(); return null; nCuenta; System.out.println(nCuenta.getMessage()); if (opcion.compareTo("item4") != 0) { break MISSING_BLOCK_LABEL_611; } String nCuenta = numero; sqlQuery = (new StringBuilder()).append(sqlQuery).append("TIPO_IDEN= 02 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); sqlQueryCount = (new StringBuilder()).append(sqlQueryCount).append("TIPO_IDEN= 02 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); rs = Helper.executeCommand(sqlQueryCount); rs.next(); if (rs.getInt(1) != 1) { break MISSING_BLOCK_LABEL_589; } rs = Helper.executeCommand(sqlQuery); return rs; rs.close(); return null; nCuenta; System.out.println(nCuenta.getMessage()); if (opcion.compareTo("item5") != 0) { break MISSING_BLOCK_LABEL_759; } String nCuenta = numero; sqlQuery = (new StringBuilder()).append(sqlQuery).append("TIPO_IDEN= 01 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); sqlQueryCount = (new StringBuilder()).append(sqlQueryCount).append("TIPO_IDEN= 01 AND DOC_IDEN='").append(numero).append("' AND COD_ACCESO= '").append(clave).append("'").toString(); rs = Helper.executeCommand(sqlQueryCount); rs.next(); if (rs.getInt(1) != 1) { break MISSING_BLOCK_LABEL_737; } rs = Helper.executeCommand(sqlQuery); return rs; rs.close(); return null; nCuenta; System.out.println(nCuenta.getMessage()); return null; } }