JobDAO jdao = new JobDAO(conn);
//create object jobDTO to hold all form values to be passed to JobDAO
final JobDTO jobDTO = new JobDTO();
//populating JobDTO with values from form
jobDTO.setEmployerID(id);
jobDTO.setDescription(description.getText());
jobDTO.setTitle(txtTitle.getText());
jdao.create(jobDTO);
In above code you basically doing job of Controller because you assigning values to your DTO and then calling create method of your DAO. This is what Controller is supposed to do. So you are right on this part except one small correction :
JobDAO jdao = new JobDAO(conn); //not preferable
JobDAO jdao = new JobDAO(); //preferred inside Controller class
Will suggest you to keep connection specific code inside your DAO. Your Controller class shouldn't know about your DB connection. You can perform this inside your create/update/delete methods of DAO.
DAO where you actually interact with DB is part of MODEL in MVC.
Just keep in mind few things :
- MVC (architectural design pattern) stresses on separation of concern. So make sure that you have well defined classes for View, Controller and Model
- Your class names should convey which component it belongs to (BaseDAO etc)
- Controller controls View and Model. So your View and Model should not be aware of each other.
And as you mentioned that you are already clear with View. So i haven't put any explanation on that.