ZetCode

MySQL Java programming e-book

The e-book has 142 pages and 51 code examples. The e-book goes quickly to the point and is loaded with practical examples which focus on one important aspect. The author's goals were clarity and conciseness. The e-book is written in plain English.

The code examples were tested on Linux and Windows. They can be run on JDK 8. After purchasing the e-book, you will obtain a ZIP file. In the ZIP file, you will find a PDF file and all code examples. The code examples are in the form of NetBeans projects.

Once you make a payment, you will also get a confirmation email from Paypal. If something goes wrong with the payment process, drop me an email at vronskij(at)gmail.com.

Price

The e-book price is 11.5 €.

About this e-book

This is MySQL Java programming e-book. This e-book covers MySQL programming in Java. It uses JDBC API, JDBI and JdbcTemplate libraries, and MyBatis and EclipseLink frameworks. The complete table of contents is listed at the end of the page.

This e-book contains seven chapters:

  1. MySQL database
  2. JDBC
  3. Data source and connection pooling
  4. JDBI
  5. Spring JdbcTemplate
  6. MyBatis persistence framework
  7. EclipseLink

The MySQL database chapter presents MySQL and its mysql and mysqladmin command line tools. It shows how to do some basic work with MySQL. The JDBC chapter covers MySQL Java programming using JDBC, which is the basic API for database programming in Java. In the Data source and connection pooling chapter, we show how to set up a data source in a command line and a web Java application.

The JDBI chapter covers JDBI interface, which is a low-level abstraction of the basic JDBC. The Spring JdbcTemplate chapter covers JdbcTemplate, which is Spring's template library for dealing with the complexities of JDBC programming. The MyBatis persistence framework chapter covers the low-level MyBatis persistence framework. Finally, the EclipseLink chapter is an introductory chapter to EclipseLink, a high-level ORM framework.

Table of Contents

  1. Preface
  2. About the author
  3. MySQL database
    1. Starting and stopping MySQL server
    2. Checking MySQL status
    3. The mysqladmin tool
    4. The mysql tool
    5. Creating a database
    6. Creating a new user
    7. Changing user password
  4. JDBC
    1. MySQL Connector/J
    2. DriverManager
    3. Connection string
    4. Secure connection
    5. MySQL version
    6. Prepared statements
    7. Retrieving data
    8. Auto-generated keys
    9. Properties
    10. Multiple statements
    11. Column headers
    12. Writing images
    13. Reading images
    14. Transaction support
    15. Batch updates
    16. Exporting to CSV file
  5. Data source and connection pooling
    1. Connection pooling
    2. Command line application
    3. Hikari connetion pool
    4. Web application
  6. JDBI
    1. Fluent API
      1. Retrieving all cars
      2. Retrieving car by its ID
      3. Data source
      4. The withHandle method
      5. Mapping custom classes
      6. Batch operations
      7. Transactions in Fluent API
    2. SQL Object API
      1. Simple example
      2. Transaction in Object API
  7. Spring JdbcTemplate
    1. The queryForObject method
    2. The queryForList method
    3. RowMapper
    4. BeanPropertyRowMapper
    5. NamedParameterJdbcTemplate
    6. Updating data
    7. SimpleJdbcInsert
    8. SqlQuery
    9. ResultSetExtractor
    10. SqlRowSet
    11. Batch updates
    12. Classic Spring application
    13. Spring Boot application
    1. MyBatis persistence framework
    2. MySQL version
    3. MySQL version 2
    4. MySQL Java Config
    5. Dynamic SQL
    6. Books example
    7. Web application
  8. EclipseLink
    1. Reading data
    2. Saving a row
    3. Spring Boot application