Before I jump into implementing the classes, let’s first understand what DAO is. If you already know what DAO is, feel free to jump to the code examples. If not, bear with me. DAO stands for Data Access Object and it is a structural pattern which isolates the business layer (logic) from the persistence layer…
Continue readingdao
How to unit test DAO components
In this tutorial you are going to learn how to create unit tests for DAOs. As a prerequisite, you fundamental knowledge of DAOs is expected. When it comes to testing DAO components, we really have 2 approaches. One is to use the mocking framework Mockito and the other is to create a couple of classes…
Continue readingIntroduction to JDBC in Spring
In this tutorial you are going to learn what the JDBC module is and hopefully you will be able to find use cases after you are done reading it. Now, let’s create a very simple table that represents an employee. CREATE TABLE Employee ( ID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(20) NOT NULL, AGE INT…
Continue reading