3. ii Oracle JDeveloper 11g Handbook: A Guide to Oracle Fusion Web Development
About the Authors
Duncan Mills is senior director of product management for Oracle’s Application Development
Tools, including Oracle JDeveloper, Oracle Enterprise Pack for Eclipse, Forms, and the ADF
Framework. Duncan is currently responsible for product direction, evangelism, and courseware
development around the development tools products. He has been working with Oracle in a
variety of application development and DBA roles since 1988. For the past fourteen years he has
been working at Oracle in both support and product development, spending the last eight years
in product management. Duncan is the co-author of the Oracle Press book Oracle JDeveloper
10g for Forms and PL/SQL Developers: A Guide to Web Development with Oracle ADF
(McGraw-Hill Professional, 2006).
For nearly three decades, Oracle, the world’s largest enterprise software company, has
provided the software and services that enable organizations to get the most up-to-date and
accurate information from their business systems. With over 275,000 customers—including 98
of the Fortune 100—Oracle supports customers in more than 145 countries. For more information
about Oracle, visit www.oracle.com.
Peter Koletzke is a technical director and principal instructor for the Enterprise e-Commerce
Solutions practice at Quovera, in Mountain View, California, and has worked in the database
industry since 1984. Peter has presented at various Oracle users group conferences more than
250 times and has won awards such as Pinnacle Publishing’s Technical Achievement, Oracle
Development Tools Users Group (ODTUG) Editor’s Choice (twice), ODTUG Best Speaker, ECO/
SEOUC Oracle Designer Award, the ODTUG Volunteer of the Year, and NYOUG Editor’s Choice
(twice). He is an Oracle ACE Director and an Oracle Certified Master. Peter has co-authored
seven other Oracle Press books (variously with Dr. Paul Dorsey, Avrom, and Duncan) about
Oracle JDeveloper, Oracle Forms and Reports, and Oracle Designer.
Quovera (www.quovera.com) is a business consulting and technology integration firm that
specializes in delivering solutions to the high technology, telecommunications, semiconductor,
manufacturing, software and services, public sector, and financial services industries. Quovera
deploys solutions that deliver optimized business processes quickly and economically, driving
increased productivity and improved operational efficiency. Founded in 1995, the company has
a track record of delivering hundreds of strategy, design, and implementation projects to over
250 Fortune 2000 and high-growth middle market companies. Quovera’s client list includes notable
organizations such as Cisco Systems, ON Semiconductor, New York State, Sun Microsystems,
Lawrence Livermore National Laboratory, Seagate, Toyota, Fujitsu, Visa, and Cendant.
Avrom Roy-Faderman works for Quovera as a Java EE consultant, architect, developer, and
instructor, specializing in the Oracle Application Development Framework, as well as an Oracle
ACE Director. He is a Sun Certified Programmer for the Java Platform and has acted as lead
developer on diverse application projects ranging from e-business and online order systems to
health-care provisioning for governmental and private organizations. He’s also a regular speaker
at Oracle user group conferences and is the co-author, with Paul Dorsey and Peter Koletzke, of
two books: the Oracle9i JDeveloper Handbook and the Oracle JDeveloper 10g Handbook, both
from McGraw-Hill and Oracle Press.
NOTe
Sample code for the hands-on practices in this book as well as errata
are available from the websites mentioned in the Introduction’s
section “Websites for Sample Files.”
4. ®
Oracle JDeveloper 11g
Handbook
A Guide to Oracle Fusion Web Development
Duncan Mills
Peter Koletzke
Avrom Roy-Faderman
New York Chicago San Francisco
Lisbon London Madrid Mexico City Milan
New Delhi San Juan Seoul Singapore Sydney Toronto
6. For Amanda, Josh, Sam, and Hissy.
—Duncan Mills
For my folks, Jan and Max.
—Peter Koletzke
For Nilakash, a sudden blue sky on a rainy day.
—Avrom Roy-Faderman
22. Foreword
I
have worked as the architect in the tools group at Oracle for the past seven
years, with the last three of those years also spent leading the development
team. In all that time, we have been driving toward a single vision. Our goal
is to create a tightly integrated, highly productive environment for a diverse
set of developers building Java-, Java EE–, and SOA-based applications. I think
what we have delivered with JDeveloper and ADF 11g is the realization of that vision.
As we have been working on building JDeveloper and ADF 11g over the past few years,
the rest of the company was getting behind us as well. JDeveloper and ADF 11g are not
only a best-of-breed development environment and runtime to build your custom
applications, but they are also the basis for all of the new products coming out of Oracle.
Oracle WebCenter 11g, Oracle SOA Suite 11g, and the next-generation Fusion packaged
applications are all built using the ADF technology using JDeveloper.
What this means is that the contents of this book will not only get you productive and
up to speed on building custom Java and J2EE applications using JDeveloper and ADF, but
they will also provide you the necessary skills to build applications with Oracle WebCenter
and Oracle SOA Suite 11g, as well as customize and extend Fusion packaged applications.
When considering the vast market of Oracle middleware and packaged applications
customers, there is a lot of opportunity for anyone with this skillset.
When thinking about a group of people qualified to write a book on this subject, I can’t
think of a better balanced team than Duncan, Peter, and Avrom. Duncan has been with
Oracle since well before our shift to Java technology and has been a key contributor in
helping us build a tool and framework that appeal to developers from a wide variety of
backgrounds. Duncan and his product management team have been on the front lines with
customers helping them adopt the 11g technology for the past two years.
xxi
23. xxii Oracle JDeveloper 11g Handbook: A Guide to Oracle Fusion Web Development
Complementing Duncan’s internal perspective is Peter, who works as an external consultant
in the market. Peter has written four previous books on JDeveloper and is a long-time guru and
presenter on the topic. He is widely known as an expert on the Oracle tools and offers a wealth
of information and experience from the view of a customer.
Rounding things off is Avrom. Avrom was previously a documentation writer in the JDeveloper
team at Oracle, and one of the most hands-on doc writers I have worked with. Avrom is able to get
deep into the technology, and then use his skills as a writer to clearly articulate to the reader on
how things work.
We are very proud of the Oracle JDeveloper and ADF 11g release and are eager for more and
more people to get their hands on it and try it out. Whether you are coming from a background of
Java, Oracle Forms, PeopleTools, C/C++, or the scripting world, I think you will find this book and
the technology it describes very approachable and powerful in helping you build applications.
—Ted Farrell
Chief Architect & SVP, Tools & Middleware
Oracle Corporation
24. Acknowledgments
B
ooks are magical and powerful things. There is something about the
handling of the medium and the absoluteness of that old business card
or ticket stub that you use as a bookmark that defines your progress and
understanding of the subject matter. Although we all have so much
information at our fingertips through online documentation and the
ubiquitous Google, the presence of a well-constructed and linear source of data in the
form of a thick wodge of paper adds some undefined quality to the learning process of
any technical subject.
When Peter and I collaborated on our last book back in 2006, we created, I think, a
unique resource for the Oracle Development community, and certainly everyone we ever
spoke to echoed that sentiment. But times move on, technology changes, and like some
kind of primeval migration instinct, the urge to write arose again and here we are. Much
has changed in that time, and much has remained the same. I still work for Oracle,
although my role and circumstances changed considerably as I uprooted my family five
and a half thousand miles from ancient Winchester in England to California. In the course
of all this upheaval, I also took on much more management responsibility for the product
management and curriculum development teams within the Oracle Tools division. None of
which is actually very conducive to freeing up time for writing, but there you go.
So why do it? Frankly, strange as it may sound, I find this stuff just too exciting. I’ve been
working with database development tools and Java frameworks for many, many years, and
I have to say that JDeveloper 11g and the Application Development Framework have reached
a level of maturity and functionality that just blows me away. Already, when I look at the
business applications that both Oracle and its customers are creating with the Fusion tools,
I see something that sets a standard that the rest of the industry is going to have a hard job
catching up with. I just want to rush out and physically shake developers out of their love
affair with the 1990s. So this book is, I suppose, a more polite way of doing that.
xxiii
25. xxiv Oracle JDeveloper 11g Handbook: A Guide to Oracle Fusion Web Development
For this book Peter and I are joined by Avrom, a long-time colleague of us both over the years
and a hugely valuable addition to the team. Avrom brings a wealth of technical knowledge and
possibly more important, practical experience of applying it. One of the roles of the technical book
writer is to be an advocate on the readers’ behalf and to ask the questions that you’ve not thought of
yet, and keep asking them until they get the answer. In this respect Avrom is tenacious, a veritable
Canadian Mountie of the technical whys and hows. This book is so much the better for that.
Peter, as my partner in crime for the last book, and so many joint technical presentations over
the years, gets the less dashing comparison with epoxy. If you want to thank any one person for
actually getting the book done and holding us together as a team, then Peter’s your man. He’s
organized and herded us through the process, always riding the deadlines and managing the
unglamorous tasks of styling and page count. All of this, and still one of the best people I know at
expressing deeply technical subjects in a totally accessible manner.
In an attempt to spread the blame I’ll say that a book is only as good as its reviewers, but of
course we’ve had a fantastic review and editing team for the Handbook. Ann Horton took on the
monumental task of technical editor at short notice and has done so well. All of these chapter
reviewers have donated their own time to make this the book it is: (in no particular order)
Dave Schneider, Eric Marcoux, Lynn Munsinger, Frank Nimphius, Shaun O’Brien, Grant Ronald,
Blaise Ribet. And a special mention must go to Glenn Maslen, who managed the review process for
us, and to the review “Dream Team” of Pam Gamer, Kate Heap, and Patrice Daux, who did such a
great job of reviewing Part V of the book in particular—a daunting task with preproduction
software. Steve Muench, the godfather of ADF Business Components, deserves a big thanks for his
help with the sample application where he helped us out of some sticky situations with advice and
much patience.
Thanks to all at Oracle Press, Lisa McClain in particular, who patiently steered us through the
whole process yet again and whose understanding of the realities of writing against preproduction
software has been invaluable.
Of course, every book needs a good foreword, and I have to thank Ted Farrell, my boss and
the real moving force behind JDeveloper and ADF, for his contribution, vision, and patience over
the last two years or so.
The last word has to be for my family: Amanda, my perfect and understanding wife (did I mention
that she is perfect?), Josh and Sam, who gave me the excuse for many hours of writing whilst sitting in
the corner at Golden State Taekwondo in San Carlos—somewhat different from the traditional coffee
shop writing environment, believe me!—and finally, of course, little Zoë, who kept me company for so
many of those early morning writing sessions. Without all of their support this simply would not have
happened. Guys, I owe you one.
—Duncan Mills
Foster City, CA, USA
October 2009
If you compare our signature lines in this acknowledgments section and know our area or do
some quick digging, you’ll find that the California communities in which we authors live form a
small triangle, in the center of which is Redwood Shores, the location of Oracle HQ. It would have
been nice if this serendipity of geographic proximity had somehow made the collaborative process
required for a multi-author book such as this much quicker and easier than any of the other seven
Oracle Press books, which I’ve co-authored variously with Duncan and Avrom and also with
Dr. Paul Dorsey (who, although he was originally signed up for this book, had to bow out early in
the process due to work pressures). However, due to a long product incubation slowed somewhat
by various corporate acquisitions “relatively quick and easy” did not happen this time.
26. Acknowledgments xxv
Throughout that long (and sometimes hard) process, we had many contributors to this rather
large volume without whom you would not be reading this and whom, therefore, I’d like to thank.
First, I’d like to extend my great appreciation to my co-authors, Duncan and Avrom. I’m constantly
in awe of how they successfully juggle the full-time demands of parenting with full-time IT work
and book work. Despite my earlier claims to a “long and hard” process, I did learned a lot from
reading, reviewing, and questioning their material.
Duncan, thanks again for hosting our FTP server as well as for your insightful and patient
mentoring and for inventing and implementing an application that shows off the great new
aspects of ADF and JDeveloper in a practical way. Sidebar to Duncan: if you are ever looking for
additional employment opportunities as a senior developer/architect . . . well, you know how to
get in touch with me.
I have the pleasure not only of working in the same company as Avrom but also of collaborating
with him on client projects. Avrom, thanks for sharing in writing your deep knowledge of ADF
internals as well as for sticking with this really long-running project. I’d like to take this
opportunity to publicly extend my apologies for all my e-nagging about the various deadlines
(but you are now two days overdue on your last time report!).
A large group of others contributed in many ways and now that their work is complete, it’s a real
pleasure to be able to thank them for their effort. Ann Horton, who worked as technical editor for the
last book Duncan and I wrote, just happens to be on a team in Oracle that was using JDeveloper 11g
(in its pre-production releases) to create applications. We couldn’t have asked for a better fit for a
technical editor. Thanks, Ann, for your expert insight and patience! Merci beaucoup to Eric Marcoux,
our other technical editor and fellow Oracle ACE Director. Eric is also one of the Fusion Middleware
11g early adopters, and his project (outside Oracle) is using the entire technology stack, including
JDeveloper 11g. Eric, your comments as a non-Oracle employee working with a real application
(also using pre-production software) were very, very helpful.
My appreciation for additional technical reviews also goes to Rich Bruno, an Oracle consultant
whom I work with on a client project at NY State Office of Alcoholism and Substance Abuse Services
(OASAS). Rich brought into his reviews a longtime, in-the-trenches knowledge of JDeveloper 9i and
10g and the Oracle database. Rich worked through many of the hands-on practices in their early
stages (no small accomplishment there) and gave helpful suggestions for many of the chapters in the
book. Our other technical reviewers on the Oracle Product Management side also provided crucial
comments and corrections, including information about features I hadn’t figured out or known on my
own. For those reviews, thanks Patrice Daux, Susan Duncan, Kate Heap, Pam Gamer, Jeff Gallus,
Steve Muench, Lynn Munsinger, Frank Nimphius, Shaun O’Brien, Blaise Ribet, Grant Ronald, and
Dave Schneider for all your valuable input. Also thanks to Glen Maslen for keeping our chapters
flowing among the Oracle group. Another thanks to the Oracle JDeveloper documentation team. The
early documentation was amazingly complete and helped greatly in learning new features.
Thanks also go to my boss, Austin Erlich, CEO of Quovera, for the flexibility in scheduling
required to balance book work with client work. I’d also like to recognize the stellar IT staff at
OASAS with whom I have worked for many years for their patience with my erratic work
schedule and for helping me stay aware that not everyone in the Oracle development
community is fully in tune with all the new aspects of Java (yet). My gratitude also goes to Karen
Cannell, Editor-in-Chief of the Oracle Development Tools User Group (ODTUG) Technical
Journal, for reviewing an early version of the book for an article in that excellent journal.
I also appreciate the professionalism and friendliness of the McGraw-Hill staff who helped
this book project manifest, especially Lisa McClain, Smita Rajan, Robert Campbell, Janet Walden,
Jean Bodeaux, and Jack Lewis with whom we worked directly.
27. xxvi Oracle JDeveloper 11g Handbook: A Guide to Oracle Fusion Web Development
As always, Mom, Dad, and Marilyn, thank you for sympathizing with and showing a constant
interest in the struggles of the book process.
Most importantly, thanks to my wife, Anne, for her understanding and support. Anne, I foresee
a vacation in the near future without the laptop.
—Peter Koletzke
San Carlos, CA, USA
October 2009
Five years is a long time.
It’s hard for me to believe, but that’s how long it’s been since the last time I wrote an
acknowledgment page, for the Oracle JDeveloper 10g Handbook. A lot has happened in that
time, for me personally, for JDeveloper, and for the world of web applications.
Everyone knows how the web has changed. What was once a vehicle for reading news and
making purchases has become a major part of our lives, and the static sequence of web pages
and forms of the old Web have turned to a proliferation of sites as interactive and dynamic as
any desktop application. And JDeveloper has changed apace: An application developed with
JDeveloper 11g bears almost as little resemblance to one developed with JDeveloper 10g as
does Facebook to trn. That’s what has made writing this book so exciting: the feeling of being
involved with a true technological revolution. So first, I must send a big “thank you” to the
JDeveloper team, just for making this possible by producing such a cool piece of software.
My life has changed pretty dramatically too, both professionally and personally. Since the
Oracle JDeveloper 10g Handbook, I’ve gone from being a member of the JDeveloper team to a
very enthusiastic partner. I’d like to thank my current (no longer new—I’m writing this close to my
fifth anniversary with them) employers, Quovera, Inc., for taking what must have seemed like a
real chance by hiring a technical writer with no proven production development experience and
helping me become the consultant and developer that I am today. In particular, I’d like to thank
both my manager of record, Austin Erlich, and my mentor and the project manager of most of my
projects, Peter Koletzke, for the understanding and flexibility they’ve shown when I’ve had to
balance the demands of paying work and the brick of paper you’re holding in your hands.
But of course, my thanks to Peter only barely begin with such abstracta as “understanding”
and “flexibility.” This is our third book together, and I’ve worked with him on any number of
development projects, as well. This man is a genius of project planning and implementation. Peter
plans it, It Gets Done, and unless you’ve actually spent a year or so in the wilds of bookland, you
probably can’t guess just how important that is. (Yes, I know you can guess it’s absolutely vital. It’s
more important than that.)
This is only my first book with Duncan Mills (although, of course, I worked with him during
my years at Oracle), but I hope it won’t be my last. In addition to balancing the sometimes tricky
load of official Oracle responsibilities and two highly opinionated co-authors (an experience I
remember well from books past), Duncan has been a consistent voice of moderation and reason
throughout the process. The massive sample application presented in this book, which Duncan
created, certainly would not have existed at all if the rest of us had gone charging off with our
wild-eyed sample application ideas, without his patient advice and guidance on what scope
would and would not prove useful in an introductory text.