Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
JDBC technology was designed to keep simple things simple. This means that the JDBC API makes everyday database tasks, like simple SELECT statements, very easy. This chapter will walk you through examples of using the JDBC API to execute common SQL statements, letting you see for yourself how easy it is to use the basic JDBC API.
By the end of this chapter, you will know how to use the JDBC API to create tables, insert values into them, query the tables, retrieve the results of the queries, and update the tables. In this process, you will learn how to use simple statements and prepared statements, and you will see an example of a stored procedure. You will also learn how to perform transactions and how to catch exceptions and warnings. Finally, you will see how to create an applet.
Chapter 3, “Advanced Tutorial,” shows you how to use the new functionality and data types in the JDBC 2.0 API. This includes new features in the java.sql package and also the new functionality in the javax.sql package. Chapter 4, “MetaData Tutorial,” shows how to use the metadata API, which is used in more sophisticated programs, such as applications that must dynamically discover and present the table structure of a target database. Chapter 5, “RowSet Tutorial,” explains rowsets and gives examples of using two different kinds of rowsets. One example uses a rowset in the context of an Enterprise JavaBeans (EJB) component.