Exception on Result Sets

Rafael Chiarinelli <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Hi all,

I'm developing a SERVELT for a WebPage and when I try to get a String of a ResultSet, occurs the following exception:

Java.SQL.SQLException : Before start of Result Set

This is the code's part with bug:

    try {
      Class.forName("org.gjt.mm.mysql.Driver").newInstance();
      conexao = DriverManager.getConnection("jdbc:mysql://localhost/Database?user=root&password=");

      st1 = conexao.createStatement();
      st2 = conexao.createStatement();
      st3 = conexao.createStatement();
      IDTemp  = request.getParameter("id");
      IDTC=Integer.parseInt(IDTemp);
      ResultSet rs = st1.executeQuery("SELECT * FROM classifgeral WHERE IDTC="+ IDTC);
      ResultSet rs2 = st2.executeQuery("SELECT * FROM tipo_classificado WHERE IDTC="+ IDTC);
      IDVS=rs.getInt("idvs");
      ResultSet rs3=st3.executeQuery("SELECT * FROM cad_visitantes WHERE id ="+ IDVS);
      tipClass=rs2.getString("TIPO");
   descClass=rs2.getString("DESCRICAO");

Somebody has a idea?

Regards,

Rafael Chiarinelli



---------------------------------
Busca Yahoo!
O serviço de busca mais completo da Internet. O que você pensar o Yahoo! encontra.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.