From the course: Java EE: Concurrency and Multithreading

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add methods in the DAO class

Add methods in the DAO class

From the course: Java EE: Concurrency and Multithreading

Start my 1-month free trial

Add methods in the DAO class

- [Instructor] Now let us add a method in the BankAccountDao to get the bank account information for all users. We'll retrieve that information from the bank account table, and once that's done, all the rows that we get out of it, we're going to make a collection of bank account bean objects. Similarly, we'll add another method in the Dao class which will fetch us the transaction information for every bank account. If there are multiple transactions, all of those rows will be contained in a list of bank account transaction beans. Let's head to the IDE. That's the Dao class. We have created a data source. This is the source from which we are going to retrieve the connection object to make the transactions. We've already tied up this data source by a constructor to our Dao class, so let's add the methods. The first one will be public. It will return us a list of bank account beans, which is this; getAllBankAccounts. What are we going to do here is, we are first going to get the…

Contents