This repository contains a demo of how to use DAO with JDBC conecting MySQL Database
- IntelliJ IDEA Community Edition 2022.1.4
- OpenJDK Runtime Environment Zulu17.38+21-CA (build 17.0.5+8-LTS)
- Version: 8.0.32
On your workspace, clone this repository and open it in your preferred IDE (I suggest IntelliJ).
You will need MySQL Workbeench to visualize all database information.
- Link to download MySQL: https://dev.mysql.com/downloads/installer/
To connect MySQL database with Java, we need MySQL Connector and JDBC API.
- Link to download MySQL Connector: https://dev.mysql.com/downloads/connector/j/
After download, put the connector in the external project libraries.
In MySQL Workbeench, execute SQL script to create database, tables and insert data.
Run DeparmentTests and SellerTest
Now you can run this classes to se all methods tests to do a simple CRUD in MySQL with Java.