Hi all:
 
    I am doing queries against a bd. After I show the ResultSet in tables (HTML).  I have a problem with the ResultSet.getString(). It seems like I only can call this function once. If  I call twice I hava errors like:
-No data found
 
Do you know if this function take the data of the ResultSet?.  (Perhaps after the first call the registry is empty....)
   
 
This is more or less the code:
 
Connection conexion;
Statement sentencia;
ResultSet resultado;
boolean mas;
String driver = "jdbc:odbc:prueba";
String usuario = "prueba";
String clave = "prueba";
 
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conexion = DriverManager.getConnection(driver,usuario,clave);
sentencia = conexion.createStatement();
resultado = sentencia.executeQuery("select columna1,columna2 from tabla");
 

mas = resultado.next();
 
out.println("<html><body>");
out.println("<table>");
 
while(mas){
      out.println("<tr>");
      out.println("<td>");
      out.println(resultado.getString(1));
      out.println("</td>");
 
      out.println("<td>");
      out.println(resultado.getString(2));
      out.println("</td>");
 
       out.println("</table>");
 
       mas = resultado.next();
 
/*HERE COMES THE PROBLEM!!!!!!!*/
 
out.println("<h2>"+resultado.getString(1)+"</h2>");
 
out.println("</body></html>")
}
 
Do you what is the problem with this second call??
 
 
Thanks a million, Daniel

Reply via email to