Re: Exception on Result Sets

viju <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <002701c2e919$68d0e510$6d00a8c0@viju>
resultset.next(); is missing

Vj
  ----- Original Message ----- 
  From: Rafael Chiarinelli 
  To: [email protected] 
  Sent: Thursday,March 13,2003 9:23 AM
  Subject: Exception on Result Sets


  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_visitan tes 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.