Advertisement
LoonerSF

Tema Dao

Aug 12th, 2012
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. package com.mx.ipn.escom.testerRest.dao;
  2.  
  3. import java.sql.ResultSet;
  4. import java.sql.SQLException;
  5. import java.util.ArrayList;
  6. import java.util.List;
  7.  
  8. import com.mx.ipn.escom.testerRest.db.Connector;
  9. import com.mx.ipn.escom.testerRest.modelo.Tema;
  10.  
  11. public class TemaDao extends Connector {
  12.     public List<Tema> getTemas() throws SQLException{
  13.         List<Tema> temas=new ArrayList<Tema>();
  14.         String query="select * from tema;";
  15.         ResultSet temp= ejecutarSelect(query);
  16.         while(temp.next()){
  17.             Integer id=temp.getInt(1);
  18.             String nb = temp.getString(2);
  19.             String ds = temp.getString(3);
  20.             temas.add(new Tema(id, nb, ds));
  21.         }
  22.         return temas;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement