Java Database Connection: JDBC and MySQL

Learn how to connect to a MySQL database with Java JDBC
4.4 (1,055 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
31,625 students enrolled
Free
Start Learning Now
  • Lectures 26
  • Length 1.5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 12/2014 English

Course Description

This course assumes you have some knowledge of databases.

----------

Join 15,000+ highly engaged students


All source code is available for download

Responsive instructor available to answer your questions.

----------

Excellent 5-Star Reviews!

Very well designed course. I like clarity and delivery of contents. I wish there were more courses from Chad !!!!

- Satish Jain

I have to say that I was extremely pleased to note that his lecture material was straightforward and to the point. I was also impressed with how well he structured the contents! His presence was felt as he periodically showed interest in my progress. I would definitely recommend his material to anyone interested in expanding their programming knowledge with additional tools.

- Marc-Alexandru

If you want to learn everything about JDBC - this is the course for you! Excellent content. Brilliant explanation.

- Vishal Kumar

----------

In this course, you learn how to connect to a MySQL database using Java JDBC.

The course starts with an overview of the JDBC API. Then you learn how to set up your development environment with the appropriate MySQL database drivers. Next the course shows you how to submit a SQL query and process the result set. Also, you learn how to perform SQL insert, updates and deletes.

The course moves on to advanced topics such as Prepared Statements to handle SQL paramaters. You also learn how to call stored procedures using various parameter types (IN, INOUT, OUT and ResultSet). Next, the course shows you how to process large data types such as BLOBs and CLOBs. Finally, the course wraps up with a section on reading database connection information from a configuration file.

Who Is This Course Suitable For?

  • Java developers: beginner, intermediate or advanced

Note: This course assumes you have some knowledge of databases.

You Will Learn How To

  • Connect to a MySQL Database with Java
  • Submit SQL statements to insert, update and delete data
  • Handle SQL parameters with Prepared Statements
  • Calls stored procedures and handle various parameter types (IN, INOUT etc..)
  • Read and write BLOB and CLOB data files
  • Configure your database connection information with properties files

Source Code

  • All source code is available for download
  • All database scripts are available for download

Course Requirements

You should have the following software already installed.

  • MySQL Database
  • Java Development Kit

What are the requirements?

  • Students should have basic knowledge of Java progamming.
  • Students should have basic experience with MySQL

What am I going to get from this course?

  • Connect to a MySQL Database with Java
  • Submit SQL statements to insert, update and delete data
  • Handle SQL parameters with Prepared Statements
  • Calls stored procedures and handle various parameter types (IN, INOUT etc..)
  • Read and write BLOB and CLOB data files
  • Configure your database connection information with properties files

What is the target audience?

  • The course is appropriate for all Java developers: beginners to advanced

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
Course Introduction
01:28
Section 2: Getting Started with JDBC
06:00

In this video tutorial, we will present an overview of Java JDBC. We discuss the following topics:

- What is JDBC?
- Features
- Database Support
- Architecture and API
- Development Process

Database Setup Overview
00:26
Install the MySQL Database
04:49
Create New Database User in MySQL Workbench
03:05
Article

Download
Download the zip file.

- http://www.luv2code.com/downloads/udemy-jdbc/jdbc-source-code-v2.zip

Extract the zip file.

The zip file contains all of the source code used in the course.

Setting up the Code
1. In Eclipse, import the project for your desired lecture

  • For example, you can import files from the directory
  • lecture-03-setting-up-dev-environment


2. Run the database setup script

  • Each lecture has a specific database setup script
  • You must run this before running the application
  • The script is located in the “sql” subdirectory of each lecture
  • For example with lecture 3, you will find it here:
  • lecture-03-setting-up-dev-environment/jdbc-test/sql/table-setup.sql
  • You can run the SQL script using a SQL tool such as MySQL Workbench


3. Change the database connection info

  • In the source code, update the database URL, user id and password for your local environment


4. Finally, run the program in Eclipse

06:21

In this video, you will learn how to set up your development environment. This includes downloading the JDBC driver, configuring the driver in Eclipse. Finally, we'll run aprogram to test the database connection.

Section 3: Performing Basic JDBC Operations
03:56

In this video, you will learn how to submit a SQL query to the database and process the result set.

Getting rid of MySQL SSL Warning Message
Article
02:33

In this video, you will learn how to insert new data into the database.

03:01

In this video, you will learn how to update data in the database.

02:26

In this video, you will learn how to delete data from the database.

04:34

In this video, you will learn how to use prepared statements with JDBC.

Section 4: Calling Stored Procedures
06:16

In this video, you will learn how to call stored procedures with Java. This video focuses on using IN parameters.

03:07

In this video, you will learn how to call stored procedures with Java. This video focuses on using INIOUT parameters.

03:57

In this video, you will learn how to call stored procedures with Java. This video focuses on using OUT parameters.

02:44

In this video, you will learn how to call stored procedures with Java. This video focuses on handling result sets returned from the stored procedure.

Section 5: Transactions and MetaData
05:49

In this video you will learn how to use transactions with JDBC. This includes how to disable the auto-commit property on a database connection. Also, you will learn how to call the methods to perform a commit or rollback.

05:12

In this video, you will learn how to access database metadata with JDBC.

03:50

In this video, you will learn how to read ResultSet metadata with JDBC.

Section 6: Handling BLOBs and CLOBs
07:29

In this video, you will learn how to read and write BLOBs with JDBC.

05:42

In this video, you will learn how to read and write CLOBs with JDBC.

Section 7: Database Configuration
03:07

In this video, you will learn how to read database connection information from a properties file.

Section 8: Summary
Summary
01:11
Section 9: Discount Coupon for More of My Java Training
Discount Coupon for More of My Java Training
00:41
Direct Links to My Java Courses
Article

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Chad Darby, Popular Java Instructor - 60,000+ Students

Chád (shod) Darby is an author, instructor and speaker in the Java development world.

Chád is a contributing author to several Java books, including Professional Java E-Commerce (Wrox Press), Beginning Java Networking (Wrox Press), and XML and Web Services Unleashed (Sams Publishing).

Chád has Java certifications from Oracle and IBM. He holds a B.S. in Computer Science from Carnegie Mellon University.

Ready to start learning?
Start Learning Now