
Java 11 Cookbook
A definitive guide to learning the key concepts of modern application development, 2nd Edition
- 802 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Java 11 Cookbook
A definitive guide to learning the key concepts of modern application development, 2nd Edition
About this book
Solutions for modular, functional, reactive, GUI, network, and multithreaded programming
Key Features
- Explore the latest features of Java 11 to implement efficient and reliable code
- Develop memory-efficient applications, understanding new garbage collection in Java 11
- Create restful webservices and microservices with Spring boot 2 and Docker
Book Description
For more than three decades, Java has been on the forefront of developing robust software that has helped versatile businesses meet their requirements. Being one of the most widely used programming languages in history, it's imperative for Java developers to discover effective ways of using it in order to take full advantage of the power of the latest Java features. Java 11 Cookbook offers a range of software development solutions with simple and straightforward Java 11 code examples to help you build a modern software system.
Starting with the installation of Java, each recipe addresses various problem by explaining the solution and offering insights into how it works. You'll explore the new features added to Java 11 that will make your application modular, secure, and fast. The book contains recipes on functional programming, GUI programming, concurrent programming, and database programming in Java. You'll also be taken through the new features introduced in JDK 18.3 and 18.9.
By the end of this book, you'll be equipped with the skills required to write robust, scalable, and optimal Java code effectively.
What you will learn
- Set up JDK and understand what's new in the JDK 11 installation
- Implement object-oriented designs using classes and interfaces
- Manage operating system processes
- Create a modular application with clear dependencies
- Build graphical user interfaces using JavaFX
- Use the new HTTP Client API
- Explore the new diagnostic features in Java 11
- Discover how to use the new JShell REPL tool
Who this book is for
The book is for intermediate-to-advanced Java programmers who want to make their applications fast, secure, and scalable.
Frequently asked questions
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Information
Database Programming
- Connecting to a database using JDBC
- Setting up the tables required for DB interactions
- Performing CRUD operations using JDBC
- Using the Hikari Connection Pool (HikariCP)
- Using prepared statements
- Using transactions
- Working with large objects
- Executing stored procedures
- Using batch operations for a large set of data
- Using MyBatis for CRUD operations
- Using the Java Persistence API and Hibernate
Introduction
- Installing the database by following the vendor instructions.
- Adding the dependency on a .jar to the application with the database-specific driver.
- Creating a user, database, and database schemaâtables, views, stored procedures, and so on.
- Connecting to the database from the application.
- Constructing an SQL statement directly using JDBC or indirectly using JPA.
- Executing the SQL statement directly using JDBC or committing data changes using JPA.
- Using the result of the execution.
- Closing the database connection and other resources.
Connecting to a database using JDBC
How to do it...
- Select the database you would like to work with. There are good commercial databases and good open source databases. The only thing we are going to assume is that the database of your choice supports Structured Query Language (SQL), which is a standardized language that allows you to perform CRUD operations on a database. In our recipes, we will use the standard SQL and avoid constructs and procedures specific to a particular database type.
- If the database is not installed yet, follow the vendor instructions and install it. Then, download the database driver. The most popu...
Table of contents
- Title Page
- Copyright and Credits
- Packt Upsell
- Contributors
- Preface
- Installation and a Sneak Peek into Java 11
- Fast Track to OOP - Classes and Interfaces
- Modular Programming
- Going Functional
- Streams and Pipelines
- Database Programming
- Concurrent and Multithreaded Programming
- Better Management of the OS Process
- RESTful Web Services Using Spring Boot
- Networking
- Memory Management and Debugging
- The Read-Evaluate-Print Loop (REPL) Using JShell
- Working with New Date and Time APIs
- Testing
- The New Way of Coding with Java 10 and Java 11
- GUI Programming Using JavaFX
- Other Books You May Enjoy