Learn what you need to know prior to starting this course.
- [Instructor] In order to be successful in this course there's a few things that you need to know, so let's jump in. First and foremost you need to know the basic syntax of Java. Now I don't expect you to be an expert in the Java world, but I do expect you to be able to read and write some basic flow control and some basic aspects of the language itself. I also expect you to be able to use common libraries from the java and javax packages and I expect you to understand how imports work and how to import code from those packages.
Now for this course we're going to use a Java 11 baseline, but most of what we're going to do should work with older versions of Java, like 1.8, and it should be relatively future proof until the JSR spec is updated. We're also going to use Maven throughout this course and we're going to do so in order to set up our environment, so I need you to use basic Maven commands. Now I'm going to show you those commands, but you will need to have Maven installed on your system. I do want you to understand the basic concepts of dependency management in importing libraries.
Now for this course, basically we're going to use Maven to bring our driver onto the class path so that we can use it and any other logging that we may want to add to our application. We're not going to do a whole lot, but we will leverage it so I do ask you to have it installed and understand the basics. Now in this course we're also going to use Docker and we're going to do it to actually run our database. Now there's a reason that we're going to use Docker and that's because it's the easiest path for everybody to get a database running on their system regardless of operating system.
If I had to show you how to install Postgres on Windows, and then Ubuntu, and then Centos, and then Windows, and then Mac, and then the next version of Windows it would be crazy. With Docker, we can run it everywhere simply by leveraging the Docker container. Now I'm going to provide commands to run it in Linux and Mac, but it should be relatively similar for a Windows environment. Now I do want you to understand how to install Docker on your machine and I'm not going to show you how to do that, but if you follow this link on the screen you can do it yourself with their very useful documentation.
Now there's a few other tools that I'm going to use throughout this course. I'm going to use a text editor and the text editor that I use is Atom. You do not have to use Atom you can use any text editor you want. That's just what I choose to use. I'm also going to use an IDE for all of my Java code. Now I use IntelliJ Ultimate Edition. You're free to use any IDE that you want. I may do some generation of code, but I promise you if you read the documentation on your IDE you'll have very similar functions for most of what I can do in IntelliJ.
I'm also going to leverage the Terminal. Now I'm on a Mac system, so the Terminal will be BST specific, which is similar enough to Linux that most of the commands should work on both. If you're on Windows you may need to make appropriate changes, but I'll explain what I'm doing when I actually jump into Terminal and start typing things. There won't be a lot of it, but it is there. The final piece of code that you're going to need is you're going to need a Postgres client. Now we're going to use Postgres as our database of choice because I love free and open source software and it is one of the better free and open source relational databases today.
You will need that client-side library in order to baseline the database that we're going to use throughout this course. Now on my machine I can install just psql using Homebrew and if you're on a Mac system it's a great way to get psql on your machine. You can always install the full Postgres package and if you choose to do that, you don't necessarily have to use Docker. I'm going to use Docker again because it's easier, but if you're doing the full install it kind of removes some of the needs of Docker, but you're going to be on your own as far as running the database if you install the full thing locally and want to do so.
We're not going to use psql a lot, but we will use it a few times so it's important to make sure that you've got it running. Now there is OS-specific documentation at the link on your screen on how to install Postgres and a search of the web will show you everything you need to know about just getting the client library on your machine. One side note. Many IDEs, including IntelliJ Ultimate Edition, have a built in editor that allows you to use the driver and actually allow you to execute SQL statements on your machine.
If you want to go that route it's super easy and then you don't have any downloads, but again you're going to be on your own if you choose to do that, but if I were you that's actually the way I would go because it's simple and easy, especially if you're using an IDE like IntelliJ, or Eclipse, or Netbeans that have those libraries built in. But that's all you need and we're ready to get started with a little bit of JWC code.
- Deciphering JDBC terminology
- Using containerized PostgreSQL
- Creating, reading, updating, and deleting data
- The Repository pattern
- Using stored procedures
- Ordering and limiting results
- Transactions in JDBC
- Handling exceptions