This example implements a simple CRUD of products in console using Java JDBC.
The console program connects to MySQL database using an entity class to map the data and a DAO class to handle all sentences that need to execute over the database tables.
You can pull the code, build and test the functionality from console where I show you a tiny menu to make every operation of a CRUD.
Note: The database configuration starts with the host as localhost, port as 3306, user as root, password empty and database as test_products. You can change this configuration from program console and connect your own database.