All pastes #23296 Raw Edit

GooMeZ

public text v1 · immutable
#23296 ·published 2005-09-18 19:23 UTC
rendered paste body
    public void consulta() throws SQLException{
        this.conecta();
         if (conn != null){
            Statement stmt = conn.createStatement();
            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();
         }