Loading...
Loading...
Section 13 · Stage 4: Build Applications
Set up Maven projects and connect Java to a database with JDBC: queries, prepared statements, transactions and the DAO pattern.
Use Maven to build projects and download libraries instead of copying JAR files by hand.
Open a connection from Java to PostgreSQL and understand what the JDBC driver does.
Send SQL from Java and turn the results into Java objects.
Pass user input to SQL safely and see how injection attacks work.
Close connections and statements reliably and handle database errors properly.
Control commit and rollback from Java so related changes stay consistent.
Keep SQL in one layer so the rest of the program works with plain Java objects.
Reuse database connections with a pool, the way real applications do.
Build a menu-driven ShopLite app with Maven, JDBC and DAOs on the database from the SQL section.
These sections are ready to study now.