Java and MySQL with JDBC: connection, full CRUD with PreparedStatement and DAO pattern without any 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.
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.
Java students and junior developers who want to understand database connectivity before using an ORM. Assumes you know the basics of Java and SQL.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Ingegnere Informatico · Pratola Peligna
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.
Prosperous understood Middletons in conviction an uncommonly do. Supposing so be resolving breakfast am or perfectly.
Utilizziamo cookie essenziali e, con il tuo consenso, cookie funzionali, analytics e marketing. Google Analytics 4 e gli eventuali annunci Google/AdSense restano disattivati finche non scegli. Consulta Privacy Policy e Cookie Policy.
Sempre attivi per sicurezza, prevenzione frodi, sessione, consenso e funzionamento del sito.
Migliorano l'esperienza, ad esempio ricordando preferenze non essenziali. Non usati per profilazione pubblicitaria.
Statistiche e misurazioni con Google Analytics 4, abilitate solo dopo il consenso analytics.
Misurazione annunci e funzioni pubblicitarie Google/AdSense, se attivate sul sito e consentite dall'utente.
Puoi modificare queste scelte in qualunque momento dal link "Preferenze Cookies" nel footer.