Java Database Best Practices
By George Reese
May 2003
Pages: 286
ISBN 10: 0-596-00522-9 |
ISBN 13: 9780596005221




(Average of 5 Customer Reviews)


Description
Unlike other books on this topic, which focus on a single way to do things, Java Database Best Practices takes you through a wide variety of different ways to store and access data, enabling you to learn which "persistence model" is most appropriate for each type of application. This unique book covers Enterprise JavaBeans, Java Data Objects, the Java Database Connectivity API (JDBC) and other, lesser-known options.
Full Description
When creating complex Java enterprise applications, do you spend a lot of time thumbing through a myriad of books and other resources searching for what you hope will be the API that's right for the project at hand?
Java Database Best Practices rescues you from having to wade through books on each of the various APIs before figuring out which method to use! This comprehensive guide introduces each of the dominant APIs (Enterprise JavaBeans, Java Data Objects, the Java Database Connectivity API (JDBC) as well as other, lesser-known options), explores the methodology and design components that use those APIs, and then offers practices most appropriate for different types and makes of databases, as well as different types of applications.
Java Database Practices also examines database design, from table and database architecture to normalization, and offers a number of best practices for handling these tasks as well. Learn how to move through the various forms of normalization, understand when to denormalize, and even get detailed instructions on optimizing your SQL queries to make the best use of your database structure. Through it all, this book focuses on practical application of these techniques, giving you information that can immediately be applied to your own enterprise projects.
Enterprise applications in today's world are about data-- whether it be information about a product to buy, a user's credit card information, or the color that a customer prefers for their auto purchases. And just as data has grown in importance, the task of accessing that data has grown in complexity. Until now, you have been left on your own to determine which model best suits your application, and how best to use your chosen API. Java Database Practices is the one stop reference book to help you determine what's appropriate for your specific project at hand. Whether it's choosing between an alphabet soup of APIs and technologies--EJB, JDO, JDBC, SQL, RDBMS, OODBMS, and more on the horizon, this book is an indispensable resource you can't do without.
Featured customer reviews

Java Database Best Practices Review,
July 15 2004
Submitted by Anonymous Reader [
Respond |
View]
...It is not helpful to suggest to neophyte database developers that character PKs are desirable, that multi-part PKs are tolerated...
not this again: the vulgar form of 3NF definition -> all attributes are about the key, the whole key, and nothing but the key; so help me codd.
there are reasons why java enterprise developers are viewed as silly juveniles by real database designers (this is one of the best): surrogate keys defeat the whole purpose of a relational database, since such a PK does not meaningfully describe the row. both database theorists and practioners long ago figured out that surrogate keys (the term of art) are bad juju.
please read Date's book, and an applied book such as Elmasri/Navathe (any one will do). if this is "best", we're all in trouble. and we are.
Java Database Best Practices Review,
December 03 2003
Submitted by Stjepan Brbot
[
Respond |
View]
Unwillinglly I have to say that this book presents very fluent but in the same time superficial reading matter. Probably the title is the most misleading part of it since everybody seeing "
... Best Practices" expect that such a book is intended for very experienced readers willing to compare their own work with "generally accepted best practices". Contrary to it,
this book is intended for newbies in database design and database application development. Athough there is some good general chapters, I really didn't expect to encounter in this book chapters like "SQL" explining basics of SQL language or similar newbie stuff. Many thing are only touched not witout deeper comparison or explanations with tests from existing works (that is practice for me).
Java Database Best Practices Review,
August 08 2003
Submitted by Jason Hunter
[
Respond |
View]
The first review of this book is probably in reference to a "Java Enterprise Best Pratices" since it was written before this book was published and since Ravi Mahalingam wrote the exact same review for that book.
This book is great for anyone who will be using a database in a java application. It will help any newcomer to avoid the pitfalls that som many others have fallen into. It gives a great overview of the different persistent models that are currently available, and shows examples of their uses.
Read all reviews
Java Database Best Practices Review,
May 31 2003
Submitted by George Reese
[
Respond |
View]
Bob,
I believe there is a bit of a misunderstanding related to your disagreements:
#1"It is not helpful to suggest to neophyte database developers that
character PKs are desirable"
I agree entirely. In fact, I counsel against that on page 29 where I say,
"I recommend the use
of 64-bit, sequentially generated integers for primary key columns." I admit, I should have called this out in a sidebar as a best practice. Nevertheless, it is right at the front of the section on how to design primary keys.
The best practice you seem to be arguing against, however, is the following:
"Use fixed character data types like CHAR for primary keys in lookup
tables."
The important clause here is,
"in lookup tables". This best practice is
about how one deals with designing primary keys for lookup tables like
Country, State, Locale, etc. For such tables you want a fixed character
data type as the primary key. Fixed, because indexing and searching against variable
length types is much less efficient and character because applications
almost always primarily search lookup tables based on human readable
codes. The alternative would be to create a State table like this:
CREATE TABLE State (
state_id BIGINT NOT NULL PRIMARY KEY,
code CHAR(2) NOT NULL,
name VARCHAR(50) NOT NULL,
UNIQUE INDEX ( code ) );
This approach would have zero performance or design benefit, add additional
application complexity, reduce end user usability, and require an
extra, useless index.
In short, I strongly stand by this best practice as it is in the book.
#2 "including the name of a table in the primary key is done to make
things easier when using CASE tools"
Personally, I do not like the fact that CASE tools are easier to work
with when you follow this best practice. I hate redundant naming, which
is what this best practice causes. However, the fact remains that it is
easier to work with, and more important, collaborate in CASE tools when
you follow this best practice. Even if you do not use a CASE tool, this
best practice does no harm to maintainability, efficiency, or
functionality of the model--the primary things you attempt to impact
with a best practice. I thus stand by this practice even though I find the need for it annoying.
#3 "I also feel that of all the CDs that could have been used in table
2-1, the author could have chosen more neutral examples to be used to
illustrate business data and sample queries."
I have two points to make regarding this issue.
First, what I like about O'Reilly books is that they contain a little bit of the
personality of the authors in them. That is also why I begin the
chapters with quotes from philosophers. By including examples from my
music tastes, I am adding a bit of my personality to the book. And
there is nothing offensive in any of these titles. In fact, they should be familiar to most of my audience, especially those with even a passing familiarity with Punk, New Wave, Industrial, and Alternative rock.
The Cure's Pornography is universally
acclaimed as the Cure's most important work. And the Cure is one of the
most influential bands to modern rock, pop and alternative. Though,
admittedly, modern pop is more influenced by
Disintegration and
Wish than
Pornography.
Garbage, on the other hand, is a very
popular modern band. One of their song's is the theme to the James Bond
movie
The World Is Not Enough.
On a final note, I have included this CD example in both editions of
Database Programming with JDBC and Java and the only negative comment
I have ever heard was from a professional reviewer rightfully complaining about me
misspelling the name of the Sex Pistols album.
I hope this response clears up some confusion.
George
Java Database Best Practices Review,
May 31 2003
Submitted by Bob Grove
[
Respond |
View]
**** Sample chapter feedback ****
I saw the following statement in another review of this book:
Unlike most other books, this book is produced by Java experts
This is evident. As the database sample chapter did do a fair job of expressing goals of normalization and provided useful examples and commentary, the entire section regarding table design and primary keys is flawed. There are a number of sidebars labeled "best practice" which do not promote any best practices I am aware of. It is not helpful to suggest to neophyte database developers that character PKs are desirable, that multi-part PKs are tolerated, and that including the name of a table in the primary key is done to make things easier when using CASE tools. There are some appropriate suggestions such as using integrity constraints and cautioning against one-to-one relationships.
I also feel that of all the CDs that could have been used in table 2-1, the author could have chosen more neutral examples to be used to illustrate business data and sample queries. I'm not a prude, but I cannot share titles like "Pornography" and "Garbage" and discuss them (as example data) with my students because it may offend someone and put them off the subject. As it is presented, this book seems unsuitable even as a supplemental text for training. It may be of value to those who have few expectations of the quality or integrity of their persistent storage designs.
Please bring back Dave Ensor and Ian Stevenson! These guys understood and explained "best practice" very well in their O'Reilly title "Oracle Design".
Java Database Best Practices Review,
April 10 2003
Submitted by Ravi Mahalingam
[
Respond |
View]
Unlike most other books, this book is produced by Java experts. the book assumes prior knowledge of the topics and does not intend to take a beginner from ignorance to knowledge.
This book is not intended for beginners but experts in the Java domain designing enterprise level systems or even maintaining them for system
performance and enhancements.
The book is well written and all the potential gotchas and the mistakes commonly done in application design and development are outlined with appropriate alternate solutions.
The book covers all aspects of java and ejb application development and their best practices.
Overall, this a good book to have and will be used by experienced java developers and the not so experienced.
Media reviews
"More database applications are written in Java, so DBAs need to become more conversant in Java. The perfect way to do just that is to read George Reese's 'Java Database Best Practices,' a book just published in June 2003. When starting out with Java, it can be easy to get buried in an avalance of acronyms (EJB, JDO, JDBC) and new technology. Reese's book will help you to navigate your way successfully through your Java database application design and development projects."
--Craig S. Mullins, "Database Trends and Applications," September 2003
"For such a relatively thin book (267pp), it touches on a wealth of topics vital to the subject at hand...'Java Database Best Practices' accomplishes what it sets out to do. This is a book that might be handy to have to pass around your development team in the design phase to get you all on the same page when making some critical choices. This book could also well serve those, such as managers perhaps, seeking a broad survey of Java database programming. I also feel that this book would make an excellent companion text for a college database programming course using Java."
--Jason Menard, JavaRanch.com, June 2003
http://www.javaranch.com/bunkhouse/Miscellaneous.jsp#0596005229
Read all reviews