
A very important note for what follows!
Install the Java development kit (JDK) and Eclipse for Java developers to follow along, using a bash shell on Windows 10 or macOS, and optionally Visual Studio Code for editing.
Create a GitHub repository for the advanced java course, set public visibility, add a readme, a gitignore, an MIT license, and clone it locally with git clone.
Explore building a Java program from a text editor and command line while installing Visual Studio Code extensions, including the Java Extension Pack, to write, test, and debug Java apps.
Install the code command in path via the command palette to launch Visual Studio Code from the terminal, then restart your bash terminal if needed.
Create a simple Java program by building a project with source and bin folders, adding App.java in package app, and running it from the command line with java app/app.java.
Learn to compile a Java program with Java C, direct class files to a bin folder, and run it with java, while practicing Bash and Visual Studio Code.
Learn how to configure the git editor in bash, choosing between vim, nano, or code, and set global core.editor and related environment variables for persistent editor settings.
Learn how to use a gitignore file to prevent binary and temporary files, like startup class and tmp, from being tracked, and check git status to verify ignored items.
Master a git workflow using branches for collaboration or work solo on the trunk, merge, and use git status, git add *, git commit -m, and git push origin master.
Learn to use git branches, create and switch to a test branch from master, work on separate code copies with commits and pushes, then merge back to master.
Merge the test branch into master, push updates to the remote, and delete branches locally or remotely as needed.
Learn how git pull keeps your local Java project up to date by fetching and merging remote changes, syncing with origin master.
Explore Eclipse and Git by setting a workspace to a local repository, creating a Java project and class, and identifying source control indicators in the IDE.
Learn how build systems replace eclipse builds for large projects. Explore Ant, Maven, and Gradle, and practice using them from the bash shell before integrating with Eclipse.
Install Maven to use the command line or follow along in Eclipse, download from Apache.org, configure it, and verify by running mvn.
Generate a Maven project from the command line using archetype generate, then explore the Quickstart archetype and the resulting pom.xml and src/main/java structure.
Package a Maven project into a jar with mvn package, note the default jar packaging in pom.xml, and run the app using mvn exec:java with the main class.
Import existing maven projects into Eclipse using File, Import, Maven, Existing Maven Projects, then browse to the git repository root to import multiple projects at once.
Create a Maven project from scratch in eclipse by selecting the Maven archetype quickstart, configuring groupId and artifactId, and generating the project in a Git repository.
Learn how to run maven goals from Eclipse by creating a Maven build run configuration, setting the project base directory, and packaging to produce a jar.
Learn how to download jar dependencies with Maven, set up a Maven project, manage dependencies in pom.xml, and import libraries like Guava to streamline Java builds.
Explore a guava multiset example, showing how to create a hash multiset, add elements, and print them, while illustrating how maven streamlines jar management and project imports.
Learn to add dependencies to a pom.xml from Eclipse using the dependencies view, including Guava, and note the large repository index download and removal of the Guava type bundle.
Explore how pom.xml drives Maven builds, using the Maven reference, Eclipse views, and the effective POM concept, including parent and super POM and dependency hierarchy.
Explore how mvn lists Maven goals and lifecycles and how the default build lifecycle runs compile, test, and package in order, with site and clean as other options.
Explore Gradle as a modern build system inspired by Maven and Ant, learn command-line and Eclipse workflows, install and run Gradle, and understand Groovy-based build scripts.
Explore how Gradle structures a Java project with build.gradle and settings.gradle. See how Gradle resolves repositories, organizes sources under src/main/java and resources, and uses tasks like build and run.
Explore how to connect Java applications to relational databases with JDBC, focusing on SQLite as the starting point, and compare SQL usage across SQLite, MySQL, and Oracle.
Create a Gradle-based Eclipse project to work with a SQLite database by adding a SQLite driver dependency and refreshing the Gradle project, with guidance on working sets and dependencies.
Create a user table in a database using sql: define id as integer primary key and name as not null text, using create table, drop table, and if not exists.
Insert data into a table using SQL insert, then query with a JDBC result set and display id and name for Bob and Mary.
Explore prepared statements for safe, efficient data insertion and reuse of SQL. Bind parameters for IDs and names with placeholders to prevent SQL injection and enable repeated inserts.
Learn how to install and configure MySQL community server and the MySQL Workbench, including auto-start, root password setup, and using a client tool to connect to a multi-user database.
Connect to a running MySQL server with the mysql client and MySQL Workbench, ensuring mysqld is active on localhost:3306, then create and use the database people for jdbc work.
Create a MySQL table named user with id int primary key and name text not null, compare MySQL to SQLite, and connect with Jdbc to insert and retrieve data.
Learn to connect a Java project to MySQL using the official MySQL Connector/J driver, add the Gradle dependency, refresh the project, and commit changes with Git.
Learn advanced Java demonstrates connecting to a MySQL database with JDBC, building the connection string for localhost:3306/people, and handling driver class changes. Understand root credentials and server time zone considerations.
Download the MySQL Connector jar with Maven, add the dependency to pom.xml, and refresh the Eclipse project with Maven update to verify the jar.
Implement a functional database class with connect and disconnect methods using DriverManager and a URL, handling exceptions and testing the connection in App.java.
Create a user class in a Java project to mirror a database table, with id and name, constructors, getters, setters, and an autoincrement primary key in MySQL or SQLite.
Define a user dao by extending a generic dao, add a getAll method returning a List<User>, and implement a MySQL-backed UserDao with save and retrieve operations.
Learn to save users using a DAO pattern by establishing a database connection, using prepared statements to insert a user name, and wrapping SQL exceptions in a runtime DaoException.
Learn to retrieve users with get all and find by id using a DAO, executing select id, name from user, iterating the result set, and building a user list.
Implement the find by ID method in the user DAO using a prepared statement to query by ID and return an optional user.
Implement deletion of a user by id using a prepared statement, execute the update, and handle SQL exceptions with a try-catch.
Update users by implementing the update method with a database connection and a prepared statement to set name by id. Validate by retrieving the user and renaming Saturn to Snoopy.
Move database settings from hardcoded values to a properties file in src/main/resources/config/db.properties, load it via getResourceAsStream, build the connection URL, and handle errors with try-catch.
Explore profiles in Java applications to switch run-time settings between development and production using system properties and config files.
Refactor a properties loader into a profile class with a static getProperties method that loads a named properties file, defaults environment to dev, and throws a runtime exception on failure.
Explore integration testing with JUnit in a Java project and contrast unit testing with integration testing. Learn how tests connect to a database and consider in-memory or fake databases.
Learn to write a JUnit test for the profile class by configuring a dedicated test resources folder, loading test properties, and asserting the loaded database name matches 'people test'.
Learn to create a MySQL non-root user, grant scoped privileges, and configure a test connection in Java with JUnit tests, securing passwords and avoiding direct plain-text credentials.
Connect to the database before each test using a test profile and properties, then close the connection after tests in a user dao test.
Learn how to generate test users by loading words from Charles Dickens' Great Expectations text file and turning them into usernames using Java streams, Files.lines, and Path.get.
Convert text file to a stream of words using split and regex, map to users, flatten with flatMap, filter by length, lowercase, and collect into a list of test users.
Write a JUnit test to verify saving multiple users. Implement a get max id method to retrieve the highest autoincrement id from the user table and validate saved records.
Finish writing the test for saving multiple users by adding get users in range method using a prepared statement to fetch by min and max id, returning a list.
Write a test for the get all method by ordering results with id in the sql, then compare retrieved and expected users using a sublist and size checks.
Demonstrate writing a step-by-step JUnit test to verify the delete method, using multiple test users, selecting a mid-list target, and confirming alignment of database and retrieved lists after deletion.
Learn to check for methods and fields in java using get field, get declared field, get method, and get declared method, handling no such field or method exceptions.
Call methods via the reflection API by obtaining a declared method and invoking it on an instance, using setAccessible to bypass private access and handle IllegalAccessException.
Learn to set a field via the reflection API in Java by using getField and getDeclaredField, then setAccessible for private fields in testing contexts.
Create a simple annotation in Java, using Target and Retention to specify where it applies and when it is kept. Explore using reflection to inspect annotated fields at runtime.
Learn how to define and use annotation attributes, set default values, enforce primitive and array types, and mark fields as primary keys to map fields to database columns.
Learn how to extract attribute values from field annotations in Java, iterate fields, handle empty annotations, read values and isKey, and derive field and column names for database mapping.
Discover and learn advanced aspects of Java programming, and some important Java-related concepts and technologies.
This course can help you bridge the gap between the knowledge you have as a self-taught Java developer, junior developer or new IT graduate, and the knowledge that professional developers may have.
We'll introduce you to version control, important design patterns, JDBC, and many other important Java technologies and programming concepts, including Spring, Swing and multi-tier architecture.
When you finish the course you'll be able to create simple web services in Java using Spring MVC, and connect to them using desktop clients.