use of com.tomasio.projects.trainning.dao.DAOFactory 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);
// }
}
use of com.tomasio.projects.trainning.dao.DAOFactory in project trainning by fernandotomasio.
the class AnotacaoTeste method main.
public static void main(String[] args) throws DAOException {
DAOFactory factory = new DefaultDAOFactory();
CursoDAO cursoDAO = factory.getCursoDAO();
System.out.println(cursoDAO.findAll(null, null, null, null).size());
System.out.println("ok");
}
Aggregations