In our current system, the balance of the single account is stored in a file and read and written by the BalanceStore class. In our new design, we will make the Account responsible for reading the balance straight out of a database instead. It’s refactoring time again!
Once you have installed MySQL you will need to create a database and user. This can be done simply, using the setup-bank.sql script:
CREATE DATABASE bank;
CREATE USER 'teller'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON bank.* TO 'teller'@'localhost';
As you can see, this script creates a database called bank. It then adds a user teller with password password and ...