You will learn about the following in this chapter:
What a database is
What JDBC is
How to create a database using JDBC and Java
How to populate databases with data
How to query databases using JDBC
How to update databases collected in a GUI
Data storage and retrieval are important elements in the majority of the software systems in use today. Some software, such as banking and inventory systems, is almost entirely composed of data storage and retrieval logic. Other software systems, such as scheduling systems and search engines, make heavy use of databases to feed the data into their algorithms.
Databases are of particular interest to Java programmers. Many of the Web sites that we build provide a browser-based front end to a database back end. Many of the servlets and Enterprise JavaBeans (EJB) that we write store and retrieve their data in databases.
The Java Database Connection (JDBC) is the preferred Java approach to accessing data in a database. It is a simple, yet powerful, approach to the problem of accessing data that is stored in different formats using different database software.
In this chapter, you will learn how to add database processing to your programs using JDBC. First, we will look at what a database is composed of. Following that we will study how JDBC works. Finally, you will learn how to use JDBC to store, modify, and retrieve data from a database.