Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- if(nombre.length() == 0){
- JOptionPane.showMessageDialog(null, "ERROR 404");
- return false;
- }else{
- String urlLink = "http://localhost/ejercito/consulta.php?Nombre="+nombre;
- URL url = new URL(urlLink);
- HttpURLConnection conn = (HttpURLConnection) url.openConnection();
- conn.setRequestMethod("GET");
- BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- StringBuffer sb = new StringBuffer();
- in.close();
- System.out.println(sb.toString());
- return true;
- }
- }catch(Exception x){
- JOptionPane.showMessageDialog(null, "ERROR 404");
- return false;
- }
Add Comment
Please, Sign In to add comment