Book Image

Java 9 Cookbook

By : Mohamed Sanaulla, Nick Samoylov
Book Image

Java 9 Cookbook

By: Mohamed Sanaulla, Nick Samoylov

Overview of this book

<p>Java is an object-oriented programming language. It is one of the most widely accepted languages because of its design and programming features, particularly in its promise that you can write a program once and run it anywhere.</p> <p>This cookbook offers a range of software development examples in simple and straightforward Java 9 code, providing step-by-step resources and time-saving methods to help you solve data problems efficiently. Starting with the installation of Java, each recipe addresses a specific problem, with a discussion that explains the solution and offers insight into how it works.</p> <p>We cover major concepts such as Project Jigsaw and various tools that will enable you to modularize your applications. You will learn new features in the form of recipes that will make your applications modular, secure, and fast.</p>
Table of Contents (22 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Interacting with the database


In this recipe, we will look at how to integrate with a database to create, read, modify, and delete the data. For this, we will set up a MySQL database with the required table. Subsequently, we will update the data in a table from our Spring Boot application. 

We will be using Windows as the platform of development for this recipe. You can perform a similar action on Linux as well, but you would first have to set up your MySQL database.

Getting ready

Before we start integrating our application with the database, we need to set up the database locally on our development machines. In the subsequent sections, we will download and install MySQL tools and then create a sample table with some data, which we will use with our application.

Installing MySQL tools

First, download the MySQL installer from https://dev.mysql.com/downloads/windows/installer/5.7.html. This MySQL bundle is for Windows only. Follow the onscreen instructions to successfully install MySQL along with...