In organizations, data is usually kept in relational databases. Java defines Java Database Connectivity (JDBC) as an abstraction for accessing any database that supports SQL.
In our example, we will use MySQL, which can be downloaded from https://www.mysql.com/, but in principle it can be any other database, such as PostgreSQL, Oracle, MS SQL and many others. To connect to a MySQL server, we can use a JDBC MySQL driver:
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.39</version> </dependency>
If you would like to use a different database, then you can use your favorite search engine and find the suitable JDBC driver. The interaction code will remain the same, and if you use ...