QueryByCode não funciona

Iai pessoal tudo bom?

Vamos a dúvida:

estou tentando chamar um código que traz alguns atributos do meu db para mostrar, mas sempre está aparecendo este erro:


type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.sql.SQLException: Illegal operation on empty result set.
root cause

java.sql.SQLException: Illegal operation on empty result set.

Aqui está o código que exibe todos os resultados(está funcionando normal):

    public String showCorrespondencias() {
        String retorno = "";

        try {
            Class.forName("org.gjt.mm.mysql.Driver").newInstance();
            Connection conn = DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/numeracao_correspondencia", "root", "");
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("select ano_num, destino, assunto, tipo_doc, ger_div, seguranca_info from correspondencia");
            while (rs.next()) {
                String txt_ano_num = rs.getString("ano_num");
                String txt_destino = rs.getString("destino");
                String txt_assunto = rs.getString("assunto");
                String txt_tipo_doc = rs.getString("tipo_doc");
                String txt_ger_div = rs.getString("ger_div");
                String txt_seguranca_info = rs.getString("seguranca_info");

                retorno = retorno + "<tr>";
                retorno = retorno + "<td><a href='registroCorrespondencia.jsp?ano_num=" + txt_ano_num + "'>" + txt_ano_num + "</td>";
                retorno = retorno + "<td>" + txt_destino + "</td>";
                retorno = retorno + "<td>" + txt_assunto + "</td>";
                retorno = retorno + "<td>" + txt_tipo_doc + "</td>";
                retorno = retorno + "<td>" + txt_ger_div + "</td>";
                retorno = retorno + "<td>" + txt_seguranca_info + "</td>";
                retorno = retorno + "</tr>";

            }
        } catch (InstantiationException ex) {
            ex.printStackTrace();
        } catch (IllegalAccessException ex) {
            ex.printStackTrace();
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        return retorno;
    }

e aqui está o código que chama as informações do BD para exibir pro usuário, a chamada no mysql está normal mais não sei se o erro é aqui:

    public String showCorrespondencias() {
        String retorno = "";

        try {
            Class.forName("org.gjt.mm.mysql.Driver").newInstance();
            Connection conn = DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/numeracao_correspondencia", "root", "");
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("select ano_num, destino, assunto, tipo_doc, ger_div, seguranca_info from correspondencia");
            while (rs.next()) {
                String txt_ano_num = rs.getString("ano_num");
                String txt_destino = rs.getString("destino");
                String txt_assunto = rs.getString("assunto");
                String txt_tipo_doc = rs.getString("tipo_doc");
                String txt_ger_div = rs.getString("ger_div");
                String txt_seguranca_info = rs.getString("seguranca_info");

                retorno = retorno + "<tr>";
                retorno = retorno + "<td><a href='registroCorrespondencia.jsp?ano_num=" + txt_ano_num + "'>" + txt_ano_num + "</td>";
                retorno = retorno + "<td>" + txt_destino + "</td>";
                retorno = retorno + "<td>" + txt_assunto + "</td>";
                retorno = retorno + "<td>" + txt_tipo_doc + "</td>";
                retorno = retorno + "<td>" + txt_ger_div + "</td>";
                retorno = retorno + "<td>" + txt_seguranca_info + "</td>";
                retorno = retorno + "</tr>";

            }
        } catch (InstantiationException ex) {
            ex.printStackTrace();
        } catch (IllegalAccessException ex) {
            ex.printStackTrace();
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        return retorno;
    }

E a página onde é exibida as informações é esta aqui:

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="br.com.bb.pool.*"%>
<%@page import="java.sql.*"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Alterar Correspondencia</title>
    </head>
    <script>
        function Validar()
        {
        document.forms[0].submit();
            
        }
    </script>
    <body>
        <%
          //  if (session.getAttribute("loginUsuario")==null) {
        %>
            <!--jsp:forward page="erro.jsp"/-->
        <%
           // }
           
                   
            String ano_num = request.getParameter("ano_num");
            Correspondencia altera = new Correspondencia();
            ResultSet rs = altera.queryByCode(ano_num);
            
            String txtAno_num = rs.getString("ano_num");
            String txtAssunto = rs.getString("assunto");
            String txtDestino = rs.getString("destino");
            String txtTipo_doc = rs.getString("tipo_doc");
            String txtGer_div = rs.getString("ger_div");
            String txtSeguranca_info = rs.getString("seguranca_info");
            
        %>
        

        <table>
            <tr>
                <td>Registro de Correspondencia</td>
            </tr>
            <tr>
                <td>Ano/Número</td>
                <td>Tipo do documento</td>
            </tr>
            <tr>
                <td><%=txtAno_num%></td>
                <td><%=txtTipo_doc%></td>
            </tr>
            <tr></tr>
            <tr>
            <tr>
                <td>Destino</td>
                <td>Gerencia/Divisão</td>
            </tr>
            </tr>
            <tr></tr>
            <tr>
            <tr>
                <td><%=txtDestino%></td>
                <td><%=txtGer_div%></td>
            </tr>
            </tr>
            <tr></tr>
            <tr>
            <tr>
                <td>Assunto</td>
                <td>Segurança da Informação</td>
            </tr>
            </tr>
            <tr></tr>
            <tr>
            <tr>
                <td><%=txtAssunto%></td>
                <td><%=txtSeguranca_info%></td>
            </tr>
            </tr>
        </table>
        <br>
        <a href="listarCorrespondencias.jsp">Listar Correspondências</a>
    </body>
</html>

estou analizando e re-analizando mais não sei o que está errado.
Help plzzz!!!
Flw pessoal

select ano_num, destino, assunto, tipo_doc, ger_div, seguranca_info from correspondencia Realmente retorna alguma coisa?
use o debug e acompanhe aonde ele para.

ok, vou debugar e já posto o resultado.