public void consulta() throws SQLException{ this.conecta(); if (conn != null){ Statement stmt = conn.createStatement(); ResultSet res = stmt.executeQuery("SELECT * FROM noticias"); while(res.next()){ String titular = res.getString("titularNoticia"); String cuerpo = res.getString("cuerpoNoticia"); System.out.println(titular +" \t "+cuerpo); } res.close(); stmt.close(); conn.close(); }