use of com.tomasio.projects.trainning.dao.PlanoDAO in project trainning by fernandotomasio.
the class ImportPlanosImpl method execute.
@Override
public void execute() {
try {
DAOFactory factory = DAOUtil.getDAOFactory();
PlanoDAO dao = factory.getPlanoDAO();
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/dctp?user=root&password=123456");
Statement stm = conn.createStatement();
ResultSet rs = stm.executeQuery("SELECT * FROM plano");
while (rs.next()) {
String sigla = rs.getString("Plano");
String descricao = rs.getString("Plano");
PlanoDTO plano = new PlanoDTO();
plano.setSigla(sigla);
plano.setDescricao(descricao);
// dao.create(plano);
}
conn.close();
} catch (SQLException ex) {
Logger.getLogger(ImportCursosImpl.class.getName()).log(Level.SEVERE, null, ex);
}
// catch (DAOException ex) {
// Logger.getLogger(ImportCursosImpl.class.getName()).log(Level.SEVERE, null, ex);
// }
}
Aggregations