Preface

Oracle is one of the most widely used database systems in the world. It runs on virtually all platforms, from Windows-based PCs to UNIX servers. It also comes with an array of programming tools and environments and provides access to the database from a variety of high-level programming languages.

In recent years, more and more universities in the United States and elsewhere are using Oracle in their database courses as the primary vehicle to illustrate database concepts and principles. This has resulted in the need for a concise book on Oracle programming to supplement the traditional text in the database courses. The main motivation for writing this book is to satisfy this need. This book can also be used by nonacademic professionals interested in learning about Oracle programming.

In this current edition, two new chapters covering Javascript and XML querying and transformation have been added, while one old chapter, SQLJ: Embedded SQL in Java, has been retired. The embedded SQLJ chapter will be made available on the Web for download for those users of the book who still need it. In addition, several new sections have been added covering session management in the Servlet API and XML Schema language for schema definition. Oracle's recent database servers, starting from version 8i, have provided increasing support for database access on the Internet. This support has been vital to many application developers who have, in the recent past, been developing three-tierWeb applications that are invoked from a Web browser. PL/SQL, the mainstay procedural language, has been enhanced with a Web Toolkit that allows for dynamic Web pages to be developed with ease. Java Servlet and Java Server Pages technology from Sun Microsystems has been embraced by Oracle, and there is strong support for developing Web applications using this technology in Oracle10g. XML, the newest technology used in current-day datainterchange applications, is also being well supported by Oracle 10g, including builtin XML parsers, XML data types for database columns, and support for importing XML data into and exporting XML data from an Oracle 10g database. In addition, there is extensive support for XML Schema, the schema language, XQuery, the XML query language, and XSLT, the XML transformation language. The new chapters and sections added in this edition cover these new technologies in detail.

The topics covered in this book are Oracle SQL, PL/SQL, Web application development using PL/SQL, database access in Java using JDBC, Javascript, Web application development using Java Servlets and Java Server Pages, and Oracle support for XML. SQL and PL/SQL are two languages at the core of the Oracle database engine and are essential to learn before working with Oracle databases. Java has become a de facto language for many to program database applications in, and knowledge of JDBC is critical in developing applications that access Oracle databases. With the proliferation of the Internet, more and more applications that access Oracle databases are being made available over theWeb. Learning the PL/SQL Web Toolkit and PL/SQL Server pages along with Java Servlets and Java Server Pages is becoming essential to programming such applications. In addition, the use of Javascript in the development of highly interactive and dynamic user interfaces in the Web applications is becoming very common, and Javascript skills are becoming very important forWeb application developers. The XML standard is making a major impact in current-day distributed and networked environments, and learning XML in the context of Oracle databases is proving to be an important skill for computer professionals.

Three sample databases are introduced early in the book, and most of the chapters use these databases for illustration purposes. These are the grade-book database, the mail-order database, and the portfolio database.

The grade-book database contains data typically tracked by an instructor of a course and includes information about students, courses being taught, which student is enrolled in which course, grading components for courses, and the individualís scores in these grading components. An application that allows instructors to update the database and students to access their grades is presented in the text.

The mail-order database contains data relevant to a mail-order company that sells items to customers. A variation of this database is used in the Web shopping application that allows users to shop on theWeb for items. The users have the ability to search for items, add and update a shopping cart, and check out.

The portfolio database contains data about companies, their share prices, and members who have an account with the brokerage company. An application that allows members to sign on to the system, obtain stock quotes, place bids, and so on is developed in the text.

Several application programs are developed in their entirety in the different programming environments discussed in the text . Other application programs are shown in part in the text, and the corresponding complete applications are available for download from the publisher's Web site.

Book Use

This book is suitable as a supplemental text for an introductory database course that covers the relational model and uses Oracle as the database system for the course projects and assignments. Course projects can be developed using Embedded SQL in C or C++, or in Java using JDBC. Web projects can be developed using the PL/SQL Web Toolkit, PL/SQL Server Pages, Java Servlets, Java Server Pages, or XML. An entire chapter is devoted to suggestions for course projects. These course projects are typically assigned in introductory database courses where a team of students start with a problem statement, write the problem specifications, design the database, create the database in Oracle, and write application programs that access the database. Some of the chapters also have review problems for the readers to go over to consolidate their understanding of the concepts presented in these chapters.

This book is also appropriate for nonacademic individuals interested in learning about Oracle. He or she can find materials on SQL, PL/SQL, PL/SQL Web Toolkit, PL/SQL Server Pages, Pro*C/C++, JDBC, Javascript, Java Servlets, Java Server Pages, and XML all in one text. This book can be considered a starting point in the exploration of what Oracle has to offer.

Supplements

The supplements for this book can be found at the following URL: www.aw.com. Please follow the link to Supplements Central. These supplements include:

All the code to a couple of other projects and solutions to the end-of-chapter exercises are available online for qualified instructors. Please contact your Addison- Wesley representative for information.

Acknowledgments

First of all, I would like to acknowledge Matt Goldstein at Addison Wesley for working with me closely and diligently to get this book out on time. The staff at Addison Wesley is always a pleasure to work with. I would also like to thank the following reviewers who have provided very useful and critical comments to improve the presentation and content of the book in all its editions: Louis Mazzucco, SUNY Institute of Technology; Panos Chrysanthis, University of Pittsburgh; S. David Wu, Lehigh University; Akira Kawaguchi, City College of New York; Louis Mazzucco, SUNY Cobleskill; Mark Barnard, Marquette University; Willie Favero, Professional; Ashesh Parekh, Professional; Laurian Chirica at CalPoly, San Luis Obispo; James Geller, New Jersey Institute of Technology; Chad Peiper, University of Illinois at Urbana-Champagne; Bina Ramamurthy, SUNY at Buffalo; Ahmet Ugur, Central Michigan University; and Sean Wang, George Mason University.

I would also like to acknowledge all my students who have diligently worked on various projects using Oracle over the past several years at Wichita State University and Georgia State University. In particular, I would like to acknowledge the effort put forth by Krissy Echols, Veena Pujari, and Radhika Venkataraman, in designing and implementing the investment portfolio database application discussed in the SQLJ chapter, and to Radhika Venkataraman for her effort in designing and implementing the Web shopping application discussed in the Java Servlets chapter.

Finally, I would like to acknowledge the support my family has shown to me during the writing of this edition of the book. Thank you, Radhu, for all the hard work and understanding, and thanks, Nannu and Nammi, for your excellent cooperation and constant encouragement during the writing of this book.