Database Java SQL

Integrating Java and MySQL: Database Development and Management Without ORM

Java and MySQL with JDBC: connection, full CRUD with PreparedStatement and DAO pattern without any ORM.

Course description

Connect Java to MySQL with JDBC Without Using an ORM

Before using Hibernate or Spring Data JPA, you need to understand what happens underneath. This course shows you how to connect Java to MySQL with JDBC directly — handwritten SQL queries, PreparedStatement, full CRUD — so you truly understand what an ORM does for you.

What You'll Learn

  • Design and create a MySQL database for a real-world scenario (hardware store management)
  • Configure a Java project with Maven and add the JDBC driver
  • Create Java classes to map MySQL tables
  • Configure MySqlDataSource and manage connection opening and closing
  • Use PreparedStatement for safe INSERTs (SQL injection prevention)
  • Implement DELETE and UPDATE operations via JDBC
  • Execute SELECT queries and return results as ArrayList
  • Search by ID with parameterized SELECT queries

The Manual Approach That Makes Everything Clear

With modern ORMs everything seems like magic — until something goes wrong. Understanding JDBC means understanding every query executed, every connection opened, every data type error. It's the foundation that makes everything else comprehensible.

Who It's For

Java students and junior developers who want to understand database connectivity before using an ORM. Assumes you know the basics of Java and SQL.

Lessons list

Let's define the project goals and build a MySQL database for a hardware store as a real-world use case — I'll show you how to structure tables and relationships before writing a single line of Java code.

Guarda lezione

Let's set up a Java project from scratch to use JDBC with MySQL — I'll show you how to add the driver to the Build Path and properly prepare the development environment for database connectivity.

Guarda lezione

I'll explain how to create a Java class that represents and maps a MySQL table — this is the entity concept, the bridge between your Java code and the relational database structure, and it's essential to understand before using any ORM.

Guarda lezione

Let's configure MySqlDataSource in Java and see how to properly manage JDBC connection open and close cycles — I'll explain why leaving connections open is critical to avoid and how to do it cleanly.

Guarda lezione

I'll show you how to use PreparedStatements in JDBC for safe INSERT operations on MySQL — we'll see how to pass parameters correctly to prevent SQL injection and save data in a structured, reliable way.

Guarda lezione

Let's see how to implement the DELETE operation in Java with JDBC — I'll show you how to build a parameterized query using PreparedStatement to safely remove specific records from the MySQL database.

Guarda lezione

I'll show you how to execute UPDATE operations with JDBC in Java — we'll build a parameterized PreparedStatement query together to update MySQL data in an effective, secure, and reusable way.

Guarda lezione

Let's see how to use SELECT queries with JDBC to read data from MySQL and return it as an ArrayList of Java objects — I'll show you how to map the ResultSet to the project's classes, completing the full CRUD cycle.

Guarda lezione

Let's take SELECT queries in JDBC further by adding ID-based search — I'll explain how to use query parameters to retrieve a specific record from the MySQL database, rounding off the complete Java CRUD implementation.

Guarda lezione
Giovanni Pace

Giovanni Pace

Ingegnere Informatico · Pratola Peligna

  • 107 Courses
About the teacher

Sono un ingegnere informatico con oltre 15 anni di esperienza nel settore ICT. Mi occupo di sviluppo software, cybersecurity, data science e intelligenza artificiale, con particolare attenzione all’innovazione e all’automazione dei processi aziendali. Da anni svolgo anche attività di docenza e formazione, creando percorsi pratici e coinvolgenti su programmazione, DevOps, AI e sicurezza informatica.

This course includes

  • Lessons 9
  • Duration 1h 21m
  • Difficulty base
  • Language it
  • Certificate No

Recently viewed