Java Reference
In-Depth Information
CHAPTER 13
Working with Databases
Almost any nontrivial application contains a database of some sort. Some applications
use in-memory databases, while others use traditional relational database management
systems (RDBMSs). Whatever the case, it is essential that every Java developer have
some skills working with databases. Over the years, the Java Database Connectivity
(JDBC) API has evolved quite a bit, and over the past couple of releases there have been
some major advancements.
This chapter covers the basics of using JDBC for working with databases. You will
learn how to perform all the standard database operations, as well as some advanced
techniques for manipulating data. You'll also learn how you can create secure database
applications and save time on development using some of the latest advancements in the
API. In the end, you will be able to develop Java applications that work with traditional
RDBMSs such as Oracle database, PostgreSQL, and MySQL.
Note To follow along with the examples in this chapter, run the cre-
ate_user.sql script to create a database user schema. Then, run the cre-
ate_database.sql script within the database schema that you just created.
The database examples in this topic are tailored for use with an Apache Derby or Oracle
database.
13-1. Connecting to a Database
Problem
Search WWH ::




Custom Search