Java Database Connectivity JDBC for beginners – Full tutorial

Published: 14 January 2022
on channel: MariaDB
9,260
43

In this video, Alejandro Duarte demonstrates how to connect a Java application to a MariaDB® database using JDBC, including executing SQL statements in a safe way to avoid SQL injection attacks, how to correctly free resources, and how to improve the performance by using connection pools.

►Read the tutorial (part 1): https://dzone.com/articles/jdbc-tutor...
►Read the tutorial (part 2): https://dzone.com/articles/jdbc-tutor...
►Read the tutorial (part 3): https://dzone.com/articles/jdbc-tutor...
►Source code: https://github.com/mariadb-developers...

Part 1 – Database connections
----------
0:00 JDBC
0:55 Creating a new empty Maven project
1:43 Installing MariaDB using Brew
2:43 Checking the current database user
3:32 Checking the server port
3:47 Setting a password
4:21 Configuring IntelliJ IDEA Ultimate
5:54 Creating a new database
7:33 Adding a JDBC driver
8:51 Opening a database connection
12:48 Closing a database connection
13:38 Closing connections on errors

Part 2 – Running SQL queries
----------
15:38 Running SQL queries
16:05 CRUD operations
19:30 Create operation (INSERT INTO)
24:32 Closing resources (try-with-resources block)
16:52 Read operation (SELECT)
31:17 Ordering result sets
32:07 Update operation (UPDATE)
35:27 Handling empty result sets
37:00 Delete operation (DELETE)

Part 3 – Database connection pools
----------
39:45 Connection pools
40:58 Adding HikariCP using Maven
42:45 Replacing DriverManager with a DataSource
44:37 Initializing the connection pool
46:51 Closing the connection pool
47:27 Getting connections from the pool
49:12 When is a connection pool needed?

►Follow Alejandro Duarte on Twitter:   / alejandro_du  
►Follow MariaDB on Twitter:   / mariadb  
►Subscribe to the MariaDB channel:    / mariadb  
►More Java videos:    • Java on MariaDB  

#Java #Databases #MariaDB #SQL #Tutorial

MariaDB is making a big impact on the world. Whether you’re checking your bank account, buying a coffee, shopping online, making a phone call, listening to music, taking out a loan, or ordering takeout–MariaDB is the backbone of applications used every day. Companies small and large, including 75% of the Fortune 500 run MariaDB, touching the lives of billions of people. With massive reach through Linux distributions, enterprise deployments, and public clouds, MariaDB is uniquely positioned as the leading database for modern application development.

Explore MariaDB: https://mariadb.com
Check out the MariaDB DeveloperHub: https://mariadb.com/developers/
Get in touch with MariaDB experts via Slack: https://mariadb-community.slack.com/


Watch video Java Database Connectivity JDBC for beginners – Full tutorial online without registration, duration hours minute second in high quality. This video was added by user MariaDB 14 January 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 9,26 once and liked it 4 people.