Instructor: Hey, in this video we're gonna learn
how to create a JSF database application.
So for our class project,
we're actually gonna build a full working JSF application
that connects to a database,
so we'll build all the front-end JSF pages
in the beans and we'll connect
to a MySQL database in the background.
Alright, so before we get into the coding,
let's look at a quick demo
on how this application will work.
So I'll just drop in the URL to the final application.
This is for a fictional university
called FooBar University,
and what we'll do is we'll keep track of students.
So right here we have a list of students that we have,
and that's from the MySQL database.
We'll be able to add a student,
and we'll also be able to perform some operations,
such as updating a student and also deleting a student.
So let's go ahead and start off
by adding a new student here.
So I'm gonna add this new student called Bill Appleby.
And his email is bill@foo.com,
and once I'm happy with all that
information for Bill Appleby,
I'll go ahead and hit the save button.
So great, so now look at our list.
Note here the first student is Bill Appleby
because we're sorting by last name.
So he shows up first.
So he's entered, we have his first his last name,
and also his email address, so this is really good.
Now what I like to do is actually change
his email address so instead of bill@foo.com,
I'll hit on update and I'll go through and update this user.
So I'll keep the first and last name the same,
but I just wanna change his email address.
So his email address is bill@luv2code.com,
because hey, we're all about love around here.
So I'll go ahead and hit save,
and so now we should see the updated entry
here for Bill Appleby.
Note his email address is bill@luv2code.com.
So very good.
So our update operation worked out just fine for us.
So now what I like to do is actually delete the user.
So I click on delete, it'll prompt me
Are you sure, I'll go ahead and hit OK,
and then it'll actually delete the user from the database.
We'll refresh our screen, and we'll note here
that Bill Appleby is no longer listed in the list
of students from the database,
so that works out for us also.
So this is really good.
So we've covered all the major operations here
that you would have in a database application.
We had the scenario of listing students,
adding students, updating, and also deleting,
and we'll learn all the key steps
on how to make that work in this video series.
Alright, let's go take a look at MySQL
as far as the database in the background.
So we have a table out there called students,
we can query that table
and then we can get the actual results.
So we see we have five students out here,
first name, last name, and email address.
So this all looks really good.
So our application will actually interact
with the database throughout the application lifecycle.
Alright, so let's figure out how we're gonna do this.
You know I like to do lists, I like roadmaps.
So the first thing we're gonna do is figure out
how to set up our database Dev environment,
then we'll learn how to list students
doing a query on the database.
Next we'll go through and learn how to add a student,
and that's by doing a SQL insert.
And then from there we'll go ahead
and perform updates on a student,
and that's using a SQL update statement.
And then finally, we'll wrap it up
by doing a delete student, so using a SQL delete statement.
And what I'll do in the following videos here
is that I'll bring things down for you
step-by-step just like I've done before.
So we'll spend a special video
on Database environment, another one on listing,
adding, updating, and deleting.
We'll do all that in separate videos
and I'll walk through all the code for you
and show you how to pull it all together.
Alright, well I'm really excited about this.
Let's go ahead and dive in
and get started.