Conclusion and Words of Advice

The Cookbook.class library file developed earlier in t he chapt er Recipe 2.4 includes a propsConnect rout ine t hat is based on t he concept s discussed here. To use it , set up t he cont ent s of t he propert ies file, Cookbook.propert ies, and copy t he file t o t he sam e locat ion where you inst alled Cookbook.class. Then you can est ablish a connect ion wit hin a program by im port ing t he Cookbook class and calling Cookbook.propsConnect rat her t han by calling Cookbook.connect .

2.12 Conclusion and Words of Advice

This chapt er discusses t he basic operat ions provided by each of our API s for handling various aspect s of int eract ing wit h t he MySQL server. These operat ions allow you t o writ e program s t hat issue any kind of query and ret rieve t he result s. Up t o t his point , weve used sim ple queries because t he focus is on t he API s rat her t han on SQL. The next chapt er focuses on SQL inst ead, t o show how t o ask t he dat abase server m ore com plex quest ions. Before you proceed, it would be a good idea t o reset t he profile t able used in t his chapt er t o a know n st at e. Several queries in lat er chapt ers use t his t able; by reinit ializing it , youll get t he sam e result s displayed in t hose chapt ers when you run t he queries shown t here. To reset t he t able, change locat ion int o t he t ables direct ory of t he recipes dist ribut ion and r un t he following com m ands: mysql cookbook profile.sql mysql cookbook profile2.sql

Chapter 3. Record Selection Techniques

Sect ion 3.1. I nt roduct ion Sect ion 3.2. Specifying Which Colum ns t o Display Sect ion 3.3. Avoiding Out put Colum n Order Problem s When Writ ing Program s Sect ion 3.4. Giving Nam es t o Out put Colum ns Sect ion 3.5. Using Colum n Aliases t o Make Program s Easier t o Writ e Sect ion 3.6. Com bining Colum ns t o Const ruct Com posit e Values Sect ion 3.7. Specifying Which Rows t o Select Sect ion 3.8. WHERE Clauses and Colum n Aliases Sect ion 3.9. Displaying Com parisons t o Find Out How Som et hing Works Sect ion 3.10. Reversing or Negat ing Query Condit ions Sect ion 3.11. Rem oving Duplicat e Rows Sect ion 3.12. Working wit h NULL Values Sect ion 3.13. Negat ing a Condit ion on a Colum n That Cont ains NULL Values Sect ion 3.14. Writ ing Com parisons I nvolving NULL in Program s Sect ion 3.15. Mapping NULL Values t o Ot her Values for Display Sect ion 3.16. Sort ing a Result Set Sect ion 3.17. Select ing Records from t he Beginning or End of a Result Set Sect ion 3.18. Pulling a Sect ion from t he Middle of a Result Set Sect ion 3.19. Choosing Appropriat e LI MI T Values Sect ion 3.20. Calculat ing LI MI T Values from Expressions Sect ion 3.21. What t o Do When LI MI T Requires t he Wrong Sort Order Sect ion 3.22. Select ing a Result Set int o an Exist ing Table